Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Error Eandling in Sales Order creation Using BAPI

Former Member
0 Likes
359

Hi all,

i am using bapi_salesorder_createfromdat2.

i am having flat file like 1 header and 3 line items like

<---header


> <-item-->

doc_num doc_type........item material

1 TA 10 100-500

1 TA 20 100-501

1 TA 30 100-502

2 TA 10 100-500

2 TA 20 100-502

..

......

i want to display only one message either creted or not created a sales document in a flat file.

i have created and internal with structure flat file and one extra field for Status.

help me out please.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
327

Hi

The Bapi function which you are using will have return variable or internal table which will have the sales order number if successfully created and errors if any ..

Using the table or variable you can update the status of the flat file and display.

2 REPLIES 2
Read only

Former Member
0 Likes
328

Hi

The Bapi function which you are using will have return variable or internal table which will have the sales order number if successfully created and errors if any ..

Using the table or variable you can update the status of the flat file and display.

Read only

Former Member
0 Likes
327

One of the tables parameter is 'RETURN'.

So

CALL FUNCTION 'BAPI_SALESORDER_CREATEFROMDAT'

importing

....

exporting

....

tables

return = t_return.

read table t_return with key type = 'E'.

if sy-subrc eq 0.

write: 'Sales order was not created'.

else.

write: 'Sales document created'.

endif.

Message was edited by: Sharath kumar R