Application Development 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: 

BAPI : "BAPI_REQUISITION_CREATE" pass the Long Text Field of *Header Note*,

0 Kudos
Hi Experts,
        i am using the BAPI : "BAPI_REQUISITION_CREATE". it' is working Fine.But i need to pass the Long Text Field of Header Note, Item Text, Item Note,Delivery text and Material P.O text through the BAPI.
Plz,Help me to Achieve this.

Thanks in Adv.
V.S.Naidu.
1 ACCEPTED SOLUTION

former_member506713
Participant
0 Kudos

Pass the values by REQUISITION_ITEM_TEXT table in the BAPI.

Regards

Lalit

8 REPLIES 8

former_member506713
Participant
0 Kudos

Pass the values by REQUISITION_ITEM_TEXT table in the BAPI.

Regards

Lalit

0 Kudos

Can Any one tell how to pass the what values should be passed to the BAPI.

V.S.Naidu

Former Member
0 Kudos

Hi,

Check the Function Module Documentation for the information.

In this table, you pass on texts for the service line. You can pass on the following:

In the field TEXT_ID: the allowed text types (e.g. line text, service text)

In the field TEXT_FORM: a SAPscript format key

In the field TEXT_LINE: the actual text lines

If TEXT_ID is empty, a line text is always generated. If FORMAT_COL is empty, the standard format key * is assigned.

For more information on the individual parameter fields, see the data element documentation in the ABAP Dictionary.

Regards,

Aditya

0 Kudos

Hi Aditya,

I have 4 types of text fields in Purchase requisition item level. 1.Item text 2.Item Note 3.Delivery text 4.Material PO text.

As per your reply if i will not pass any thing in TEXT_ID and Text Format it is updating in Item Text. But to add text in Material PO text what data we have to pass in TAXT ID and TEXT FORMAT so that it will get updated.

and where we can pass the text to update the header text.

Regards,

V S Naidu.

Edited by: Vechalapu Naidu on Jan 25, 2010 11:37 AM

0 Kudos

Below is the code for BAPI_PR_CREATE just go through it and your dbout will be solved

it has example for multi line header text as well as line items...!

Hope it helps


CLEAR GV_BAPIMEREQHEADER.
MOVE 'NB' TO GV_BAPIMEREQHEADER-PR_TYPE.
move 'X' To GV_BAPIMEREQHEADER-AUTO_SOURCE.
CLEAR GV_BAPIMEREQHEADERX.
MOVE 'X' TO GV_BAPIMEREQHEADERX-PR_TYPE.
MOVE 'X' TO GV_BAPIMEREQHEADERX-auto_source.

CLEAR WA_BAPIMEREQITEMIMP.
MOVE :
'00010' TO WA_BAPIMEREQITEMIMP-PREQ_ITEM,
**'001' TO  WA_BAPIMEREQITEMIMP-PUR_GROUP,
*'TWISTED PAIR CABLE' TO  WA_BAPIMEREQITEMIMP-SHORT_TEXT,
'C-1030' TO WA_BAPIMEREQITEMIMP-MATERIAL,
'1000' TO WA_BAPIMEREQITEMIMP-PLANT,
'100' TO WA_BAPIMEREQITEMIMP-QUANTITY,
'20091001' TO WA_BAPIMEREQITEMIMP-DELIV_DATE.

APPEND WA_BAPIMEREQITEMIMP TO GT_BAPIMEREQITEMIMP.

CLEAR WA_BAPIMEREQITEMX.
MOVE :
'00010' TO WA_BAPIMEREQITEMX-PREQ_ITEM,
'X' TO WA_BAPIMEREQITEMX-PREQ_ITEMX,
*'X' TO  WA_BAPIMEREQITEMX-PUR_GROUP,
'X' TO  WA_BAPIMEREQITEMX-SHORT_TEXT,
'X' TO WA_BAPIMEREQITEMX-MATERIAL,
'X' TO WA_BAPIMEREQITEMX-PLANT,
'X' TO WA_BAPIMEREQITEMX-QUANTITY,
'X' TO WA_BAPIMEREQITEMX-DELIV_DATE,
'X' TO WA_BAPIMEREQITEMX-EXT_PROC_PROF.
*EXT_PROC_REF_DOC
*EXT_PROC_REF_ITEM

APPEND WA_BAPIMEREQITEMX TO GT_BAPIMEREQITEMX.

CLEAR EXTRA_FIELDS.
MOVE '00010' TO EXTRA_FIELDS-BNFPO.
MOVE '12345678901' TO EXTRA_FIELDS-ZZDANOSPR_NO.
MOVE 'MUM01' TO EXTRA_FIELDS-ZZPORT.
MOVE '20100505' TO EXTRA_FIELDS-ZZETD.
MOVE '20100506' TO EXTRA_FIELDS-ZZETA.
MOVE '123456789123456789' TO  EXTRA_FIELDS-ZZEXTWG.
MOVE TEMP TO  EXTRA_FIELDS-ZZrob.


CLEAR WA_EXTENSIONIN.
MOVE 'BAPI_TE_MEREQITEM' TO  WA_EXTENSIONIN-STRUCTURE.
MOVE EXTRA_FIELDS TO WA_EXTENSIONIN-VALUEPART1.
APPEND WA_EXTENSIONIN TO GT_EXTENSIONIN.
CLEAR WA_EXTENSIONIN.
MOVE 'BAPI_TE_MEREQITEMX' TO  WA_EXTENSIONIN-STRUCTURE.
MOVE EXTRA_FIELDS TO WA_EXTENSIONIN-VALUEPART1.
APPEND WA_EXTENSIONIN TO GT_EXTENSIONIN.


CLEAR WA_EXTENSIONOUT.
MOVE 'BAPI_TE_MEREQITEMX' TO  WA_EXTENSIONOUT-STRUCTURE.
*MOVE EXTRA_FIELDS TO WA_EXTENSIONOUT-VALUEPART1.
APPEND WA_EXTENSIONOUT TO GT_EXTENSIONOUT.

clear wa_PRITEMTEXT.
MOVE '00010' TO wa_pritemtext-preq_item.
move 'B01' TO WA_PRITEMTEXT-TEXT_ID.
MOVE 'THIS IS JUST FOR TEST' TO WA_PRITEMTEXT-TEXT_LINE.
APPEND WA_PRITEMTEXT TO GT_PRITEMTEXT.

clear wa_PRITEMTEXT.
MOVE '00010' TO wa_pritemtext-preq_item.
move 'B01' TO WA_PRITEMTEXT-TEXT_ID.
MOVE 'THIS IS THE SECOND LINE' TO WA_PRITEMTEXT-TEXT_LINE.
APPEND WA_PRITEMTEXT TO GT_PRITEMTEXT.

BREAK-POINT.

CALL FUNCTION 'BAPI_PR_CREATE'
 EXPORTING
   PRHEADER                     = GV_BAPIMEREQHEADER
   PRHEADERX                    = GV_BAPIMEREQHEADERX
*   TESTRUN                      =
 IMPORTING
   NUMBER                       = GV_NUMBER
   PRHEADEREXP                  = GV_PRHEADEREXP
  TABLES
    RETURN                       = GT_BAPIRET2
    PRITEM                       = GT_BAPIMEREQITEMIMP
    PRITEMX                      = GT_BAPIMEREQITEMX
*   PRITEMEXP                    =
*   PRITEMSOURCE                 =
*   PRACCOUNT                    =
*   PRACCOUNTPROITSEGMENT        =
*   PRACCOUNTX                   =
*   PRADDRDELIVERY               =
    PRITEMTEXT                   = GT_PRITEMTEXT
*   PRHEADERTEXT                 =
    EXTENSIONIN                  = GT_EXTENSIONIN
*    EXTENSIONOUT                 = GT_EXTENSIONOUT
*   PRVERSION                    =
*   PRVERSIONX                   =
*   ALLVERSIONS                  =
*   PRCOMPONENTS                 =
*   PRCOMPONENTSX                =
*   SERVICEOUTLINE               =
*   SERVICEOUTLINEX              =
*   SERVICELINES                 =
*   SERVICELINESX                =
*   SERVICELIMIT                 =
*   SERVICELIMITX                =
*   SERVICECONTRACTLIMITS        =
*   SERVICECONTRACTLIMITSX       =
*   SERVICEACCOUNT               =
*   SERVICEACCOUNTX              =
*   SERVICELONGTEXTS             =
*   SERIALNUMBER                 =
*   SERIALNUMBERX                =
          .

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
* EXPORTING
*   WAIT          =
* IMPORTING
*   RETURN        =
          .


WRITE : 'THE PR CREATED IS : -',GV_NUMBER.

Former Member
0 Kudos

Hi Guys,

am having similar problem is htere any way i can pass the header text(HEADER note to the BAPI BAPI_REQUISITION_CREATE?

Thanks,

Swapna

0 Kudos

Dear Swapna,

I am not a find any solutions for this once. I think using u201CBAPI_REQUISITION_CREATEu201D BAPI where is no option for Header Text.

But in u201CBAPI_PR_CREATEu201D There is Input Table:-PRITEMTEXT the values are

PREQ_NO = ''.

PREQ_ITEM = '00001'.

TEXT_ID = 'B01'.

TEXT_FORM = '01'.

TEXT_LINE = 'LINE ITEM TEXT-01/01'.

Header Text will save if you pass the values in the Table.

Regards,

V S Naidu.

0 Kudos

Hi Sapna,

PL use BAPI_PR_CREATE instead of the old one.

Rgds

J