Quantcast
Channel: SCN : All Content - SAP Gateway
Viewing all articles
Browse latest Browse all 2823

How to create a service with deep insert input but output a single entity?

$
0
0

Hi Experts,

 

 

     I have created a service which has 2 entities.

 

     DeliveryHeader

 

     DeliveryItems

 

     StatusOutput

 

     

     Association has been defined for DeliveryHeader and  DeliveryItems.

 

    My input request message is:

 

    {

       "DN_No" : "123",

       "ShipTo" : "CNZ",

 

        "DeliveryItems" : [{

            

        "DN_No": "123",

        "Item_No": "1",

        "Quantity": "10'

       }]

  }

 

I want my output to be different entity structure that is of StatusOutput.

 

{

 

    "StatusOutput" : {

 

         "Code": "100",

         "Text" : "Successfully created DN"

}

 

}

 

 

But I am getting output same as input.

 

What I have to do to get the desired output? Please help!

 

In my create_deep_entity I have coded like this:

 

TYPESBEGIN OF t_output.

           TYPES: StatusOutputTYPE ycl_prj_create_dn_mpc_ext=>TS_STATUSOUTPUT,

          END OF t_output.


x_output-StatusOutput-code = "100".

x_output-StatusOutput-text = "Successfully created DN".


    copy_data_to_ref(

       EXPORTING

         is_data = x_output

       CHANGING

         cr_data = er_deep_entity ).

 

 

 

          

 

Thanks

Gopal


Viewing all articles
Browse latest Browse all 2823

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>