‎2011 Jun 29 6:33 AM
codes below is in a enhancement
data: lt_BANF_RS like table of /BSHCN/BANF_RS with header line.
select * from /BSHCN/BANF_RS
into corresponding fields of table lt_banf_rs
where frggr = stn_frggr and
FRGSX = stn_frgst .
LOOP AT lt_banf_rs.
BSH_STRING1 = lt_banf_rs-ifclause.
TAB-LINE = 'PROGRAM subpool.' .
append TAB.
TAB-LINE = `FORM BSH_CHECK_ADD USING CEBAN1 TYPE CEBAN`.
append TAB.
TAB-LINE = ` CHANGING BSH_C TYPE C.` .
append TAB.
TAB-LINE = ` IF ` .
append TAB.
TAB-LINE = BSH_STRING1 .
append TAB.
TAB-LINE = ` . ` .
append TAB.
TAB-LINE = ` BSH_C = 'X'. ELSE. BSH_C = ''. ENDIF. ` .
append TAB.
TAB-LINE = `ENDFORM. ` .
append TAB.
fname = 'BSH_CHECK_ADD'.
*generate subroutine pool TAB name PROG*
*message MESS*
*shortdump-id SID.*
if SY-SUBRC = 0.
perform (FNAME) in program (PROG) USING CEBAN changing bshc if found.
IF SY-SUBRC = 0.
IF bshc = 'X'.
stn_frggr = lt_banf_rs-frggr1.
stn_frgst = lt_banf_rs-frgsx1.
exit.
ENDIF.
ENDIF.
elseif SY-SUBRC = 4.
message MESS type 'S' DISPLAY LIKE 'W'.
elseif SY-SUBRC = 8.
message SID type 'S' DISPLAY LIKE 'W'.
endif.
ENDLOOP.
problem is generation is in a loop, when runing at the 2nd time, it goes wrong
Is there any way of clearing this pool, before I can generate it again?
‎2011 Jun 29 6:48 AM
Hi WOFR,
Before the select query, clear & Refresh the internal table.
after append TAB give clear tab. like append TAB. clear TAB.
Thanks & Regards,
Vallamuthu M
‎2011 Jun 29 6:48 AM
Hi WOFR,
Before the select query, clear & Refresh the internal table.
after append TAB give clear tab. like append TAB. clear TAB.
Thanks & Regards,
Vallamuthu M
‎2011 Jun 29 7:00 AM
the error message system gives is that there can only be one "PROGRAM" statement
"Each ABAP program can contain only one "REPORT", "PROGRAM", or "FUNCTION-POOL". statement."
I don't know if there is any way of clearing this whole subroutine pool for another generation?
I am already changing the "if endif" into " if... elseif... elseif.........endif"
hopefully it works
previous question still remains, just for curiosity
‎2011 Jun 29 7:06 AM