‎2007 Dec 28 10:06 PM
I have a Z_Temp table which has 51 colums like NKEY, NTEM001, NTEM002.... NTEM050. This table will be joined on Z_JOIN table (columns NOTE, TXT) ON NTEM*= NOTE.
( NTEM001 = NOTE, NTEM002 = NOTE, NTEM003 = NOTE .....)
For all NTEM* columns that are not initial, I need to get TXT column from Z_JOIN table and send it to a Sapscript form.
What is the best approach in doing this ?
Thanks.
‎2007 Dec 29 3:50 AM
First make a select from the first table.
The make a second select from the other table.
Loop at first table.
read the second table with key values
move the two columns to a final itab.
append final itab.
endloop.
‎2007 Dec 29 3:50 AM
First make a select from the first table.
The make a second select from the other table.
Loop at first table.
read the second table with key values
move the two columns to a final itab.
append final itab.
endloop.
‎2007 Dec 29 2:57 PM
I got until the loop at first table. How do I check if the 50 columns are initial or not. I don't want to give 50 IF statements. I would like to do something like this
v_counter = 1
DO 50 TIMES. * this will return 1 row
v_column = 'itab-NTEM'
v_column+15(3) = v_counter.
IF NOT v_column IS INITIAL. *** This line of code fails
(some code here)
ENDIF.
v_counter = v_counter + 1.
ENDDO.
Any ideas.
‎2007 Dec 29 4:11 PM
Horizontal scrolling in a single table record is possible with the DO...VARYING... construct, please read the F1 help on the same.
Also check this link
Link:[Repetitive Structures|http://help.sap.com/saphelp_47x200/helpdata/en/4f/d52808575e11d189270000e8322f96/content.htm ]
something like this
DATA:
ntem TYPE z_temp-ntem001
DO 50 TIMES VARYING ntem FROM ntem001 NEXT ntem002.
IF ntem IS NOT INITIAL.
your code.
ENDIF.
ENDDO
Edited by: Rajesh on Dec 29, 2007 9:46 PM