Skip to Content
0
Nov 18, 2020 at 11:24 AM

line items repeating in PO texts

57 Views

Hi gurus,

I've made an adobe form and i've written this code for item text and scope of work for our PO but it is concatinating the line items of all the texts into a single field. below is the code and the Output that is generating. What i want is that line item text of one material shouldn't repeat in the next material. Any help regarding this would be highly appreciated.

LOOP AT item INTO wa_item WHERE loekz IS INITIAL.

data: i type num value 1,
      k TYPE num value 10,
      num TYPE num.


concatenate 'Service #' i+1 into lv_service SEPARATED BY space.

**For Scope of Work
data   : lv_name1 TYPE THEAD-TDNAME.
move HEADER-EBELN to lv_name1.
 num = num + k.
*num = num + i.

CONCATENATE  lv_name1 '000' num INTO lv_name1.
CLEAR: tline.

CALL FUNCTION 'READ_TEXT'
  EXPORTING
*   CLIENT                        = SY-MANDT
    ID                            = 'F01'
    LANGUAGE                      = 'E'
    NAME                          =  lv_name1
    OBJECT                        = 'EKPO'
  TABLES
    LINES                         = TLINE
 EXCEPTIONS
   ID                            = 1
   LANGUAGE                      = 2
   NAME                          = 3
   NOT_FOUND                     = 4
   OBJECT                        = 5
   REFERENCE_CHECK               = 6
   WRONG_ACCESS_TO_ARCHIVE       = 7
   OTHERS                        = 8
          .
IF SY-SUBRC EQ 0.
LOOP AT TLINE WHERE TDLINE IS NOT INITIAL.
  CONCATENATE lv_sow  TLINE-TDLINE INTO lv_sow  SEPARATED BY lf.
ENDLOOP.
CONDENSE lv_sow .

SHIFT lv_sow  LEFT DELETING LEADING LF.

ENDIF.
*move num to wa_item-msr_item.
*modify item from wa_item.

"For Item Desceiption
CALL FUNCTION 'READ_TEXT'
  EXPORTING
*   CLIENT                        = SY-MANDT
    ID                            = 'F03'
    LANGUAGE                      = 'E'
    NAME                          = lv_name1
    OBJECT                        = 'EKPO'
  TABLES
    LINES                         = TLINE
 EXCEPTIONS
   ID                            = 1
   LANGUAGE                      = 2
   NAME                          = 3
   NOT_FOUND                     = 4
   OBJECT                        = 5
   REFERENCE_CHECK               = 6
   WRONG_ACCESS_TO_ARCHIVE       = 7
   OTHERS                        = 8
          .
IF SY-SUBRC EQ 0.
LOOP AT TLINE WHERE TDLINE IS NOT INITIAL.
  CONCATENATE lv_des  TLINE-TDLINE INTO lv_des   SEPARATED BY LF.
ENDLOOP.
CONDENSE lv_des  .

SHIFT lv_des  LEFT DELETING LEADING LF.
ENDIF.

CLEAR: TLINE.

endloop.

Regards,

Hamza.

Attachments

screenshot-11.png (43.5 kB)