cancel
Showing results for 
Search instead for 
Did you mean: 

Using Bapi BAPI_PO_CREATE1

Former Member
0 Kudos

Hi Guys,

Would somebody please help me to resolve this problem.

I have the list of PO and user can click on Copy PO button to make the copy of the PO, I tried using BAPI_PO_CREATE1 and pass the values of PO_HEADER of my table to BAPI importing POHEADER, I get an error return from the BAPI that I need to include po_items as well. I don't understand why do I need to give the table of PO_Items in the return parameter of the BAPI, How come it is not in the import paramateres list?

Thanks

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Can you be more clear....

when you check TABLES option of the above FM for POITEMS, then when used in UI(WD), it should be under exporting&Importing or Under changing parameters it should be there

Former Member
0 Kudos

I have the list of PO_Headers in my table. user can choose one to make a copy of that PO. In order to copy the PO I am creating a new one with BAPI_PO_CREATE1. I am still tryting to get how does the bapi work. Why do I need po_headersx structure?

should I pass the list of PO_Items of PO to POITEM table parameter of the BAPI?

thx

Former Member
0 Kudos

Hi,

What is the functionality of this COPY button. It shuold move the current PO entires to other one and create another PO is that So.

po_headersx is used for enhancements right. I guess you should pass X to that structure.

ForPO creation, you need to pass the Items also.....right.

One thing you do,

SE37, Run the BAPI by passing the values. Check wether the PO is created or not. Then same values you can pass to the UI by filling the respective tables.

Check for the same in the ABAP General Forum, then try to pass the values in UI.

Edited by: Lekha on Oct 21, 2009 12:51 PM

Edited by: Lekha on Oct 21, 2009 12:52 PM

Former Member
0 Kudos

Thanks Lekha,

Do u know how to set all the fields of po_headersx strudture to 'X' without typing all the field names. In some sort of a loop?

Former Member
0 Kudos

Hi,

Is the above strucutre listed under any node.

If Yes, then get the node info IF_WD_CONTEXT_NODE_INFO for that node and use the method -GET_ATTRIBUTES or GET_ATTRIBUTE_NAMES which retruns the attribute names.

Loop thorough them and use the SET_ATTRIBUTE method of if_wd_context_node(get that particluar node reference) and the value as 'X.

loop at lt_attributes into ls_attributes

lo_nd_node->
set_attribute
exporting
name = ls_attributes-name
value = 'X'
endloop.

Regards,

Lekha.

Edited by: Lekha on Oct 21, 2009 2:22 PM

Former Member
0 Kudos

hi

pls refer the related thread :

regards,

amit