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

BAPI_PO_CREATE1 error in codeing

Former Member
0 Likes
433

Hi,

I am doing open purchase order upload prog using BAPO_PO_CREATE1.Here i am passing the internal table data to POHEADER,and same i want to do for POHEADERX.I dont know what to pass there and same fro the POITEMX also.the coding i given below

LOOP AT DATA_TAB.

POHEADER-DOC_TYPE = DATA_TAB-BSART.

POHEADER-VENDOR = DATA_TAB-LIFNR.

POHEADER-PURCH_ORG = DATA_TAB-EKORG.

POHEADER-PURCH_ORG = DATA_TAB-EKGRP.

APPEND POHEADER.

POHEADERX-DOC_TYPE =

POHEADERX-VENDOR =

POHEADERX-PURCH_ORG =

POHEADERX-PURCH_ORG =

APPEND POHEADERX.

XXXXXXXXXXXXXXXX

APPEND POITEM.

ENDLOOP.

same case for the POITEMX also i dont know what to pass.

pls help me to solve the issue as i am doing first time using bapi.

Thanks,

RAJ.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
397

HI Rajendra

The Structure/Tables with X -extension is to set the updating flags.

The fields that are set in the X strcutures are only use for updation.

Apart from this in few structure, we will find a Field for UPDATE_FLAG, this is to identify if we want to insert/delete/update.

In your case it should be:

LOOP AT DATA_TAB.

POHEADER-DOC_TYPE = DATA_TAB-BSART.

POHEADER-VENDOR = DATA_TAB-LIFNR.

POHEADER-PURCH_ORG = DATA_TAB-EKORG.

POHEADER-PURCH_ORG = DATA_TAB-EKGRP.

APPEND POHEADER.

POHEADERX-DOC_TYPE = 'X'.

POHEADERX-VENDOR = 'X'.

POHEADERX-PURCH_ORG = 'X'.

POHEADERX-PURCH_ORG = 'X'.

APPEND POHEADERX.

XXXXXXXXXXXXXXXX

APPEND POITEM.

ENDLOOP.

Also check the example in documentation of the FM for more info.

Hope this info gives you some idea.

Kind Regards

Eswar

2 REPLIES 2
Read only

Former Member
0 Likes
398

HI Rajendra

The Structure/Tables with X -extension is to set the updating flags.

The fields that are set in the X strcutures are only use for updation.

Apart from this in few structure, we will find a Field for UPDATE_FLAG, this is to identify if we want to insert/delete/update.

In your case it should be:

LOOP AT DATA_TAB.

POHEADER-DOC_TYPE = DATA_TAB-BSART.

POHEADER-VENDOR = DATA_TAB-LIFNR.

POHEADER-PURCH_ORG = DATA_TAB-EKORG.

POHEADER-PURCH_ORG = DATA_TAB-EKGRP.

APPEND POHEADER.

POHEADERX-DOC_TYPE = 'X'.

POHEADERX-VENDOR = 'X'.

POHEADERX-PURCH_ORG = 'X'.

POHEADERX-PURCH_ORG = 'X'.

APPEND POHEADERX.

XXXXXXXXXXXXXXXX

APPEND POITEM.

ENDLOOP.

Also check the example in documentation of the FM for more info.

Hope this info gives you some idea.

Kind Regards

Eswar

Read only

0 Likes
397

Hi Eswar,

Thanks a lot for your kind help.

Thanks,

RAJ.