Skip to Content
-1

sap bw internal table without spaces in start routine

Hi,

I need your help please.

I have source data correctly in the debug mode . But in Work area and Internal table , values for the fields are having prefix with a space so I am missing one char in the required field when look up.

Please help where to correct the logic .

TYPES : BEGIN OF TY_TEMP1,
EQUIPMENT TYPE /BI0/OIEQUIPMENT,
/BIC/ZCFLDNAM TYPE /BIC/OIZCFLDNAM,
/BIC/ZCKLART TYPE /BIC/OIZCKLART,
/BIC/ZCTABLE TYPE /BIC/OIZCTABLE,
/BIC/ZCFLDVAL TYPE /BIC/OIZCFLDVAL,

END OF TY_TEMP1.

TYPES : BEGIN OF TY_TEMP2,

EQUIPMENT TYPE /BI0/OIEQUIPMENT,
/BIC/ZCFLDNAM TYPE /BIC/OIZCFLDNAM,
/BIC/ZCKLART TYPE /BIC/OIZCKLART,
/BIC/ZCTABLE TYPE /BIC/OIZCTABLE,
/BIC/ZCFLDVAL TYPE /BIC/OIZCFLDVAL,

END OF TY_TEMP2.

DATA: IT_TEMP1 TYPE STANDARD TABLE OF TY_TEMP1.
DATA: IT_TEMP2 TYPE STANDARD TABLE OF TY_TEMP2.


DATA : IT_SOURCE TYPE STANDARD TABLE OF _TY_S_SC_1,
WA_TEMP1 TYPE TY_TEMP1.
*
REFRESH IT_SOURCE[].
IT_SOURCE[] = SOURCE_PACKAGE[].
SORT IT_SOURCE BY EQUIPMENT /BIC/ZCFLDNAM ASCENDING.

LOOP AT IT_SOURCE INTO WA_TEMP1
WHERE /BIC/ZCFLDNAM = 'READING_METHOD' OR /BIC/ZCFLDNAM =
'OUT_RDR_ID'.
IF WA_TEMP1-/BIC/ZCFLDNAM = 'READING_METHOD'.
APPEND WA_TEMP1 TO IT_TEMP1.
ELSEIF WA_TEMP1-/BIC/ZCFLDNAM ='OUT_RDR_ID' .
APPEND WA_TEMP1 TO IT_TEMP2.
ENDIF.
ENDLOOP.
SORT SOURCE_PACKAGE BY EQUIPMENT /BIC/ZCFLDNAM ASCENDING.

debug.png

debug1.png

workarea.png

debug.png (25.8 kB)
debug1.png (21.6 kB)
workarea.png (29.9 kB)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    Mar 22 at 12:25 AM

    your source table and tempt workarea have difference structure so it became move characters from internal table lines to workarea when you LOOP. you should define a correct structure, and if you want to use some fields only, try the move-corresponding.

    Add comment
    10|10000 characters needed characters exceeded