2007 Jan 10 8:34 PM
Does ABAP have something like a WITH clause?
Other languages allow me to something like ...
WITH myrec DO
{do some processing}
ENDWITH
I find that I am ...
wa-field1 = 'newdata1'.
wa-field1 = 'newdata2'.
...
wa-field99 = 'newdata99'.
... seems very labourious
2007 Jan 10 8:35 PM
HI,
Welcome to SDN...
I dont believe that ABAP has <b>WITH</b> Clause...
ABAP Have some of below clauses...
<b>SELECT
ENDSELECT
INTO
WHERE
HAVING
ORDER-BY
GROUP-BY
FROM</b>
u can also use loops like...
<b>DO...ENDDO.
WHILE....ENDWHILE.
LOOP....ENDLOOP.</b>
Regards
CNU
Does ABAP have something like a WITH clause?
Other languages allow me to something like ...
WITH myrec DO
{do some processing}
ENDWITH
I find that I am ...
wa-field1 = 'newdata1'.
wa-field1 = 'newdata2'.
...
wa-field99 = 'newdata99'.
... seems very labourious
2007 Jan 10 8:35 PM
HI,
Welcome to SDN...
I dont believe that ABAP has <b>WITH</b> Clause...
ABAP Have some of below clauses...
<b>SELECT
ENDSELECT
INTO
WHERE
HAVING
ORDER-BY
GROUP-BY
FROM</b>
u can also use loops like...
<b>DO...ENDDO.
WHILE....ENDWHILE.
LOOP....ENDLOOP.</b>
Regards
CNU
2007 Jan 10 8:39 PM
Nothing like that, but of cousre your requirement can be done in ABAP other ways. For example, If you want to dynamically fill a field, you can use the ASSIGN COMPONENT statement. I would really have to understand your required in order to point you in the right direction. Can you explain a bit more?
Regards,
Rich HEilman
2007 Jan 10 8:43 PM
For example.........
report zrich_0001.
data: begin of xstruc,
fld1(10) type c,
fld2(10) type c,
fld3(10) type c,
fld4(10) type c,
fld5(10) type c,
end of xstruc.
data: istr type table of string with header line.
field-symbols: <fs> .
istr = 'Value A'. append istr.
istr = 'Value B'. append istr.
istr = 'Value C'. append istr.
istr = 'Value D'. append istr.
istr = 'Value E'. append istr.
loop at istr.
assign component sy-tabix of structure xstruc to <fs>.
if sy-subrc <> 0.
exit.
endif.
<fs> = istr.
endloop.
write:/ xstruc-fld1,
xstruc-fld2,
xstruc-fld3,
xstruc-fld4,
xstruc-fld5.
Regards,
Rich Heilman
2007 Jan 10 8:43 PM
Hi Ian,
Perhaps you can build an macro.
Syntax:
DEFINE macro.
... &1 ... &9 ...
END-OF-DEFINITION.
Regards,
Ferry Lianto
2007 Jan 10 8:56 PM
So far things look like this
data: itab type table of t_itab,
w_itab type t_itab.
w_itab-tabname = 'Tablename'.
w_itab-position = 'Pos'.
...
append w_itab to itab.
whereas it might read ...
with w_itab do
tabname = 'Tablename'.
position = 'Pos'.
endwith
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |