Question:
Hi all,
Can we define fields in transparents table as a variable or internal table to be used in selection.
e.g:-
data: text(50).
concatenate 'pernr' 'werks' 'bukrs' into text SEPARATED BY SPACE.
clear pa0000.
select (text) from pa000 into corresponding fields of itab
where pernr = '123456'.
Is it possible, or anyone of u have some ideas how to solved this problem.
Please help.
Answer:
(macroman strikes again!)
Try to define a macro...
In the days of IBM XTs, and 20MB hard drives, my nickname was "MACROMAN"....
Get your own monniker...
And I've got a reputation for trying to re-write ABAP using macros....
_________________
Regards
R
Abap KC
SFMDR
Answer:
Hi all,
I haven't use macro before. But I just tried by myself. Still not working. The coding is
DEFINE macro.
concatenate 'pernr' 'bukrs' into v separated by space.
macro v.
END-OF-DEFINITION.
loop at itab.
define selection.
clear pa0000.
select &v from pa0000 into corresponding fields of table itab2
where pernr = itab-pernr.
endloop.
END-OF-DEFINITION.
endloop.
can anyone check this code for me.
Thank u
Answer:
Try this (sorry for not using macro , but I suppose it has to be done only once in a program):
DATA: line(72) TYPE c,
field_list LIKE TABLE OF line(72).
concatentate fld1 fld2 etc into line separated by space.
[b]append line to field_list[/b].
SELECT (field_list) FROM ....
Regards.