Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

BAPI_SALESORDER_CREATEFROMDAT2

Hi Friends,

In my function module of reuse_alv_grid_display, I have sold to party, item number, material number, quantity and UOM in T_OUTTAB = ITAB. I am using a subroutine to create sales order using bapi_salesorder_createfromdat2.

How to I need to declare the it_zat_usage table data inside my subroutine. I am using subroutines first time and please suggest me ideas.

Example:

FORM CREATE_SO.

LS_ORDERITEMSIN-ITM_NUMBER = ******

LS_ORDERITEMSIN-MATERIAL = ******

LS_ORDERITEMSIN-TARGET_QTY = ******

LS_ORDERITEMSIN-TARGET_QU = ******

APPEND LS_ORDERITEMSIN TO LT_ORDERITEMSIN.

CLEAR LS_ORDERITEMSIN.

ENDFORM.

Thanks.

Edited by: nani on May 20, 2011 10:53 AM

Former Member
replied

Alright, you dont have to define anything in the subroutine..CREATE_SO_DELIV but you have to read the record from internal table IT_ZAT_USAGE.

Within the subroutine

Read table IT_ZAT_USAGE into WA_ZAT_USAGE index SELFIELD-TABINDEX.

  • This statement reads the data into WA_ZAT_USAGE and the record is the one double clicked on

Once it reads the document int WA_ZAT_USAGE - You can put a break point here and run through. You should see the values

I am not sure about the internal table structure but you need more data to create sales order.

make sure to get items, partners, order type and so on.... To start with, use above statements to get the data into work area and see that in debug then decide what other information you required.

To pass the information to your bapi

For example,

gs_orderpartners-partn_numb = gv_sold.

you can do the following

gs_orderpartners-partn_numb = wa_zat_usage-kunnr.

good luck

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question