Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 8088

Re: Order Creation With header Long text

$
0
0

Hi Bhavana,

 

Please try with below code:

 

 

* Splitting the Long text.


CALL FUNCTION 'SWA_STRING_SPLIT'
EXPORTING
input_string                
= i_longtext
max_component_length        
= 132
TABLES
string_components           
= lt_str
EXCEPTIONS
max_component_length_invalid
= 1
OTHERS                       = 2.


LOOP AT lt_str INTO lwa_str.
IF sy-tabix EQ 1.
lwa_text_lines
-tdformat = '*'.
ELSE.
CLEAR lwa_text_lines-tdformat.
ENDIF.
lwa_text_lines
-tdline   = lwa_str-str.
APPEND lwa_text_lines TO lt_text_lines.   * Am filling the text_lines table
CLEAR lwa_text_lines.
ENDLOOP.

 

 

 

  gs_text-orderid   = gv_aufnr.(Order Number)

  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_text

          it_text_lines = lt_text_lines

          return        = lt_return

          et_numbers    = lt_numbers.

 

 

Hope this helps.

 

 

Regards

Sri


Viewing all articles
Browse latest Browse all 8088

Trending Articles