‎2007 Feb 08 2:14 PM
hi i have to 2 tables 1 contains the text and the other my final output table
the report shud display line by line for the line items
if tried to do the code like this
data: j type i.
j = 1.
loop at it_lines.
*concatenate v_text it_lines into v_text separated by space.
wa_output-tdline = it_lines-tdline.
if j = 1.
modify it_output from wa_output transporting tdline
where tdname = it_stxh-tdname.
j = j + 1.
else.
append wa_output to it_output.
endif.
endloop.
so that first time it will modify the text column with the first line and the next corresponding lines will be appended but it s getting appended with some other sales order the text and sales order are mismatching and also the it_lines is of structure in which only the text can be maintained and there s no common fields between the tables how can i overcome ths error
‎2007 Feb 08 2:19 PM
Use the read option for this .
f1 is the link between the two tables .
declare
data : cntr like Sy-tabix .
loop at itab.
Read table jtab with key f1 = itab-f1. " use this option
if sy-subrc eq 0.
jtab-fx = itab-fx.
append jtab / modify transporting index cntr . " cntr = sy-tabix.
endif.
endloop.so only the values pertaining to criteria are entered into the table .
regards,
vijay.
‎2007 Feb 08 3:17 PM
‎2007 Feb 08 3:20 PM
Hi,
Can u post how your internal tables are defined and can u be more clear on what is ur requirement.
Thanks
Rajasekhar
‎2007 Feb 08 3:32 PM
data: IT_LINES LIKE TLINE OCCURS 0 WITH HEADER LINE,
it_output is declared based on a structure
here i get the values of it_lines
CALL FUNCTION 'READ_TEXT'
EXPORTING
CLIENT = SY-MANDT
ID = '0002'
LANGUAGE = SY-LANGU
NAME = it_stxh-tdname
OBJECT = 'VBBP'
ARCHIVE_HANDLE = 0
LOCAL_CAT = ' '
IMPORTING
HEADER = header
TABLES
LINES = IT_LINES
EXCEPTIONS
ID = 1
LANGUAGE = 2
NAME = 3
NOT_FOUND = 4
OBJECT = 5
REFERENCE_CHECK = 6
WRONG_ACCESS_TO_ARCHIVE = 7
OTHERS = 8
.
in it_lines i will hav eonly text value bcos the structure is defined in that way
in it_output i have line item level data
i will modify the cotents with text if it s with the first loop , if there s so many liines maintained for a single line item i will append , when i do append it s appending with some other sales order's line ite.
‎2007 Feb 08 3:33 PM
This is the common field in both the tables like a unique key field .
regards,
vijay.
‎2007 Feb 08 3:44 PM
i said know there is no common fields between those two tables
‎2007 Feb 08 5:21 PM
Hi,
Change the code like this and try:
loop at it_lines.
clear wa_output.
wa_output-tdline = it_lines-tdline.
if sy-tabix = 1.
modify it_output from wa_output transporting tdline
where tdname = it_stxh-tdname.
else.
move-corresponding wa_output to it_output.
append it_output.
clear it_output.
endif.
endloop.
Not sure of the result. Just check and inform us.
Regards
Subramanian