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_requisition_create

Former Member
0 Likes
1,099

Hi all,

I am looking for the way to pass to the bapi in object the Header Texts for Purchase Requisition.

Did anyone else have my same problem? Do you have any suggest for me?

Thanks Regards

4 REPLIES 4
Read only

Former Member
0 Likes
761

Hi

The requisition hasn't an header table so you can try to transfer the text without assigning the item number.

Max

Read only

Former Member
0 Likes
761

Hi,

You can use the parameter REQUISITION_ITEM_TEXT to pass the text..

REQUISITION_ITEM_TEXT STRUCTURE BAPIEBANTX

In that don't populate PREQ_ITEM.Just populate the requisition number PREQ_NO.

Hope this helps..

Thanks,

Naren

Read only

Former Member
0 Likes
761

Hi,

You can use FM SAVE_TEXT to save PR's header text after BAPI_REQUISITION_CREATE was committed.


  ...

  CLEAR HEADER.
  HEADER-TDOBJECT = 'EBANH'.
  HEADER-TDNAME   = '0010000000'
  HEADER-TDID     = 'B01'.
  HEADER-TDSPRAS  = SY-LANGU.
                                         
  CLEAR I_LINES.
  REFRESH I_LINES.
  I_LINES-TDFORMAT = '*'.
  I_LINES-TDLINE   = 'INSERT HEADER DATA'.
  APPEND I_LINES.

  CALL FUNCTION 'SAVE_TEXT'
    EXPORTING
      CLIENT          = SY-MANDT
      HEADER          = HEADER
      SAVEMODE_DIRECT = 'X'
    IMPORTING
      NEWHEADER       = HEADER
    TABLES
      LINES           = I_LINES
    EXCEPTIONS
      ID              = 1
      LANGUAGE        = 2
      NAME            = 3
      OBJECT          = 4
      OTHERS          = 5.

  IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.

Regards,

Ferry Lianto

Read only

0 Likes
761

Ferry is correct, you will have to use SAVE_TEXT fm. You cannot insert the header text using the BAPI.