Skip to Content
author's profile photo Former Member
Former Member

Regarding replacing BAPI_PO_CREATE F.M with BAPI_PO_CREATE1

Hi All,

I have a issue when i am replacing BAPI_PO_CREATE f.m with BAPI_PO_CREATE1 F.M.

At present i am using BAPI_PO_CREATE F.M in my program.

I want to replace it with BAPI_PO_CREATE1 F.M.

But few parameters for which i am passing data in BAPI_PO_CREATE are not available in BAPI_PO_CREATE1 F.M,

So i want to know replacement fields for them in BAPI_PO_CREATE1 F.M.

These import parameters are: HEADER_ADD_DATA_RELEVANT, SKIP_ITEMS_WITH_ERROR, ITEM_ADD_DATA_RELEVANT.

These import parameters are avail in ITEM_ADD_DATA_RELEVANT F.M.

I want to know if there are any corresponding fields for these in ITEM_ADD_DATA_RELEVANT1 F.M.

Can anybody solve this issue!

Thanks in advance.

Thanks,

Deep.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Nov 21, 2007 at 08:16 AM

    ***********************************************************************

    *

    ************************************************************************

    &----


    *& Report ZBAPI_CREATE_PO *

    *& *

    &----


    REPORT ZBAPI_CREATE_PO .

    &----


    *DATA DECLARATION

    CONSTANTS : C_X VALUE 'X'.

    *Structures to hold PO header data

    DATA : HEADER LIKE BAPIMEPOHEADER ,

    HEADERX LIKE BAPIMEPOHEADERX .

    *Internal Tables to hold PO ITEM DATA

    DATA : ITEM LIKE BAPIMEPOITEM OCCURS 0 WITH HEADER LINE,

    ITEMX LIKE BAPIMEPOITEMX OCCURS 0 WITH HEADER LINE,

    **Internal table to hold messages from BAPI call

    RETURN LIKE BAPIRET2 OCCURS 0 WITH HEADER LINE.

    data : w_header(40) value 'PO Header'.

    data : ws_langu like sy-langu.

    data: V_EXPPURCHASEORDER like BAPIMEPOHEADER-PO_NUMBER.

    *text-001 = 'PO Header' - define as text element

    selection-screen begin of block b1 with frame title text-001.

    parameters : company like header-comp_code default '1000' ,

    doctyp like HEADER-DOC_TYPE default 'NB' ,

    cdate like HEADER-CREAT_DATE default sy-datum ,

    vendor like HEADER-VENDOR default 'RAJ',

    pur_org like HEADER-PURCH_ORG default '0001' ,

    pur_grp like HEADER-PUR_GROUP default '001' .

    selection-screen end of block b1.

    selection-screen begin of block b2 with frame title text-002.

    parameters : item_num like ITEM-PO_ITEM default '00020',

    material like ITEM-MATERIAL default 'M-127' ,

    plant like ITEM-PLANT default '0001' ,

    quantity like ITEM-QUANTITY default 200.

    selection-screen end of block b2.

    *&----


    **START-OF-SELECTION.

    *&----


    **DATA POPULATION

    *&----


    ws_langu = sy-langu. "Language variable

    *POPULATE HEADER DATA FOR PO

    HEADER-COMP_CODE = company .

    HEADER-DOC_TYPE = doctyp .

    HEADER-CREAT_DATE = cdate .

    HEADER-VENDOR = vendor .

    HEADER-LANGU = ws_langu .

    HEADER-PURCH_ORG = pur_org .

    HEADER-PUR_GROUP = pur_grp .

    &----


    *POPULATE HEADER FLAG.

    &----


    HEADERX-comp_code = c_x.

    HEADERX-doc_type = c_x.

    HEADERX-creat_date = c_x.

    HEADERX-vendor = c_x.

    HEADERX-langu = c_x.

    HEADERX-purch_org = c_x.

    HEADERX-pur_group = c_x.

    *HEADERX-doc_date = c_x.

    &----


    *POPULATE ITEM DATA.

    &----


    ITEM-PO_ITEM = item_num.

    ITEM-MATERIAL = material.

    ITEM-PLANT = plant.

    ITEM-QUANTITY = quantity.

    APPEND ITEM.

    &----


    *POPULATE ITEM FLAG TABLE

    &----


    ITEMX-PO_ITEM = item_num.

    ITEMX-MATERIAL = C_X.

    ITEMX-PLANT = C_X .

    *ITEMX-STGE_LOC = C_X .

    ITEMX-QUANTITY = C_X .

    *ITEMX-TAX_CODE = C_X .

    *ITEMX-ITEM_CAT = C_X .

    *ITEMX-ACCTASSCAT = C_X .

    APPEND ITEMX.

    &----


    *BAPI CALL

    &----


    CALL FUNCTION 'BAPI_PO_CREATE1'

    EXPORTING

    POHEADER = HEADER

    POHEADERX = HEADERX

    • POADDRVENDOR =

    • TESTRUN =

    IMPORTING

    EXPPURCHASEORDER = V_EXPPURCHASEORDER

    • EXPHEADER =

    • EXPPOEXPIMPHEADER =

    TABLES

    RETURN = RETURN

    POITEM = ITEM

    POITEMX = ITEMX.

    &----


    *Confirm the document creation by calling database COMMIT

    &----


    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'

    EXPORTING

    WAIT = 'X'

    • IMPORTING

    • RETURN =

    .

    end-of-selection.

    ***&----


    ****Output the messages returned from BAPI call

    ***&----


    *LOOP AT RETURN.

    WRITE / v_EXPPURCHASEORDER.

    *ENDLOOP.

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      hi,

      There is no parameter for skip faulty items in the create1 function module

      As per my knowledge the function module it self takes care abput the faulty items

      and the second paramenter i am not sure

      Regards,

      Siva chalasani

      Reward points if use full.

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.