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: 

Update long text using Bapi_alm_order_maintain

Former Member
0 Kudos

hi ,

my requirement is to update the long text value for maintenance order using bapi_alm_order_maintain.

could anyone plz expalin what are the fields i have to pass to that bapi .

thanks in advance

regards

Indira

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

I think there are 3 table you need to fill. One table with the text and the aother intable table about the entries for eg : operaiton 0010 start line and the end line . 3rd internal table is the Method internal table.

Please let me know if you need any other information.

Regards,

Naveen.

13 REPLIES 13

former_member585060
Active Contributor
0 Kudos

Hi,

    The BAPI has documentation and example, just refer the documentation once in SE37 for that Bapi.

Thanks & Regards

Bala Krishna

0 Kudos

hi bala,

thanks for your reply .

its helpful.

Former Member
0 Kudos

Hi,

I think there are 3 table you need to fill. One table with the text and the aother intable table about the entries for eg : operaiton 0010 start line and the end line . 3rd internal table is the Method internal table.

Please let me know if you need any other information.

Regards,

Naveen.

0 Kudos

hi Naveen,

i understood

but wil you plz expalin brief with sample code regarding those tables.

regards

Indira.

0 Kudos

Below code sample is for creating the first operatin text

gs_tline-tdformat = '*'.

  gs_tline-tdline   = v_text

  Append gs_tline TO et_tline.

  gs_text-orderid   = gv_aufnr.(Order Number)

  gs_text-activity  = iv_vornr. (Operation)

  gs_text-langu     = gc_lang. "'E'.

  gs_text-textstart = '1'.

  gs_text-textend   = gv_int.  " last line number, ntg but number of entries in the table et_tline

  APPEND gs_text TO et_text.

  ls_methods-refnumber  = '000001'.

  ls_methods-objecttype = 'TEXT'.

  ls_methods-method     = 'CREATE'.

  CONCATENATE gv_aufnr lv_vornr INTO ls_methods-objectkey

              IN CHARACTER MODE.

  APPEND ls_methods TO lt_methods.

 

  ls_methods-refnumber  = '000001'.

  ls_methods-objecttype = space.

  ls_methods-method     = 'SAVE'.

  APPEND ls_methods TO lt_methods.

  ls_header-orderid     = gv_aufnr.(Order Number)

  APPEND ls_header TO lt_header.

  CLEAR ls_header.

      CALL FUNCTION 'BAPI_ALM_ORDER_MAINTAIN'

        TABLES

          it_methods    = lt_methods

          it_header     = lt_header

          it_text        =  et_tline

          return        = lt_return

          et_numbers    = lt_numbers.

I hope this should help.

Regards,

Naveen

0 Kudos

Suppose you want to populate texts for two line ( Fill the rest of the columns yoursef )

BAPI_ALM_TEXT-ITEM_NO_OF_PRODUCTION_RESOURCE = '0001'

BAPI_ALM_TEXT-ITEMLANGU   = 'EN'

BAPI_ALM_TEXT-ITEMTEXTSTART = 1 " Corresponding start line in the text table

BAPI_ALM_TEXT-ITEMTEXTEND    = 3 " corresponding end line in the text table

APPEND BAPI_ALM_TEXT TO IT_TEXT.

BAPI_ALM_TEXT-ITEM_NO_OF_PRODUCTION_RESOURCE = '0001'

BAPI_ALM_TEXT-ITEMLANGU   = 'EN'

BAPI_ALM_TEXT-ITEMTEXTSTART = 4

BAPI_ALM_TEXT-ITEMTEXTEND    = 5

APPEND BAPI_ALM_TEXT TO IT_TEXT.

BAPI_ALM_TEXT_LINES-TDFORMAT = '*'.

BAPI_ALM_TEXT_LINES-TDLINE = 'item 0001 line 1'

append BAPI_ALM_TEXT_LINES to IT_TEXT_LINES.

BAPI_ALM_TEXT_LINES-TDFORMAT = '*'.

BAPI_ALM_TEXT_LINES-TDLINE = 'item 0001 line 2'

append BAPI_ALM_TEXT_LINES to IT_TEXT_LINES.

BAPI_ALM_TEXT_LINES-TDFORMAT = '*'.

BAPI_ALM_TEXT_LINES-TDLINE = 'item 0001 line 3'

append BAPI_ALM_TEXT_LINES to IT_TEXT_LINES.

And  ofcourse you will need to add save to the method tab as suggested above

BAPI_ALM_TEXT_LINES-TDFORMAT = '*'.

BAPI_ALM_TEXT_LINES-TDLINE = 'item 0002 line 1'

append BAPI_ALM_TEXT_LINES to IT_TEXT_LINES.

BAPI_ALM_TEXT_LINES-TDFORMAT = '*'.

BAPI_ALM_TEXT_LINES-TDLINE = 'item 0002 line 2'

append BAPI_ALM_TEXT_LINES to IT_TEXT_LINES.

0 Kudos

hi Naveen ,

for operation- long text works fine.

but when i give the same code to header- long text its showing error as "Text 020999995000100000001 ID AVOT language EN not found"

wil you please explain how to solve this issue

0 Kudos

Hi Indira,

can you show what code you have written.

Regards,

Naveen.

0 Kudos

hi Naveen ,

below i just pasted  code for header long text .

  wa_et_header-orderid     = gv_aufnr.(Order Number)

move 'CREATE' to wa_et_methods-method.

move wa_et_header-orderid to wa_et_methods-objectkey.

wa_et_methods-objecttype = 'HEADER'.

  APPEND wa_et_header TO it_header.

  CLEAR wa_et_header.

wa_et_methods-refnumber = 1

move 'CREATE' to wa_et_methods-method.

move wa_et_header-orderid to wa_et_methods-objectkey.

wa_et_methods-objecttype = 'TEXT'.

append wa_et_methods to it_methods.

clear wa_et__methods.

wa_et_methods-refnumber = 1

move 'CREATE' to wa_et_methods-method.

move wa_et_header-orderid to wa_et_methods-objectkey.

wa_et_methods-objecttype = 'TEXT'.

append wa_et_methods to it_methods.

wa_et_methods-refnumber = 1

move 'CREATE' to wa_et_methods-method.

wa_et_methods-objecttype = 'OPERATION'.

CONCATENATE gv_aufnr lv_vornr INTO wa_et_methods-objectkey 

      append wa_et_methods to it_methods.

wa_et__methods-refnumber  = '000001'. 

wa_et__methods-objecttype = space.

wa_et__methods-method     = 'SAVE'.

  APPEND wa_et_methods TO it_methods.

CALL FUNCTION 'BAPI_ALM_ORDER_MAINTAIN' 

        TABLES

          it_methods    = it_methods

          it_header     = it_header

          it_text        =  it_text

          return        = it_return

          et_numbers    = it_numbers.

0 Kudos

Hi,

Please fill the internal table IT_TEXT_LINES which is passed to BAPI.

Regards,

Naveen

0 Kudos

hi

i filled and tried that aslo

but its not working

0 Kudos

Hi 

Suppose if it is not working, then once the order is created, you can use FM - SAVE_TEXT for creating the header text.

0 Kudos

hi

my requirement is third party wil create an maintenance order .

in sap we have to update those values in database using bapi_alm_order_maintain .

in this scenario how could i fetch the header long text using save_text.