on 2024 Nov 27 9:11 AM
Hi All,
I am working in S4 HANA public cloud and my requirement is to create Supplier Invoice by passing header data and navigation property "to_SelectedServiceEntrySheets" of API "/sap/opu/odata/sap/API_SUPPLIERINVOICE_PROCESS_SRV/A_SupplierInvoice".
I have created service consumption model for this API in eclipse. But, in the CREATE operation of consumption model no code generated to navigate to "to_SelectedServiceEntrySheets" as I need to supply two fields here "ServiceEntrysheet" and ServiceEntryItem" as this is mandatory to POST supplier invoice.
I have successfully supplied the header data and when I execute the code, I am getting message "No Item data supplied to post invoice". This is because above navigation property is not supplied in the payload.
Kindly suggest how I can supply the data into "to_SelectedServiceEntrySheets" of this API.
I have attached my code for reference.
Many Thanks In advance!
Request clarification before answering.
Hi VB_developer,
your request should look similar like the following that i used to call the Salesorder A2X API:
DATA deep_busi_data TYPE tys_a_sales_order_simulation_t.
DATA error_message TYPE string.
deep_busi_data = VALUE #(
sales_order_type = 'OR'
sales_organization = '1010'
distribution_channel = '10'
organization_division = '00'
sold_to_party = '10100001'
purchase_order_by_customer = 'SalesOrder Simulation'
to_item = VALUE #( (
sales_order_item = '1'
material = 'TG11' "'TG122'
requested_quantity = '5'
) )
).
DATA(response) = simulatesalesorder(
EXPORTING
i_salesorderdata = deep_busi_data
IMPORTING
r_error_message = error_message
).
Where the type is a deep structure as follows:
TYPES:
"! <p class="shorttext synchronized">A_SalesOrderSimulationType</p>
BEGIN OF tys_a_sales_order_simulation_t,
"! <em>Key property</em> SalesOrder
sales_order TYPE c LENGTH 10,
"! SalesOrderType
sales_order_type TYPE c LENGTH 4,
"! SalesOrganization
sales_organization TYPE c LENGTH 4,
"! DistributionChannel
....
customer_payment_terms TYPE c LENGTH 4,
"! PaymentMethod
payment_method TYPE c LENGTH 1,
to_item TYPE tyt_a_sales_order_item_simul_2,
END OF tys_a_sales_order_simulation_t,
"! <p class="shorttext synchronized">List of A_SalesOrderSimulationType</p>
tyt_a_sales_order_simulation_t TYPE STANDARD TABLE OF tys_a_sales_order_simulation_t WITH DEFAULT KEY.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 30 | |
| 16 | |
| 14 | |
| 6 | |
| 5 | |
| 5 | |
| 5 | |
| 4 | |
| 4 | |
| 3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.