on 08-25-2009 3:11 AM
hi...
what i did is i gather all the data in my drivers program then pass it to smartforms. now what i want to do is add LOOP in my smartform. but i dont know how to do it since i did not create the logic in smartform but in my drivers program.
please help me...
Part of my drivers program where i gather all the data then pass it to smartforms:
IF P_CTYP EQ 'SS'.
LOOP AT GT_OUTTAB INTO GS_OUTTAB .
GV_TABIX = SY-TABIX.
MOVE-CORRESPONDING GS_OUTTAB TO LT_OUTTAB2.
APPEND LT_OUTTAB2.
S_RMNTH = LT_OUTTAB2-RMNTH.
S_RYEAR = LT_OUTTAB2-RYEAR.
S_ISSDATE = LT_OUTTAB2-ISSDATE.
S_REC = LT_OUTTAB2-RECEIPT.
S_EECTB = LT_OUTTAB2-EECTB.
S_ERCTB = LT_OUTTAB2-ERCTB.
S_ECCTB = LT_OUTTAB2-ECCTB.
S_TOT = LT_OUTTAB2-TOTAL.
SELECT SNAME INTO S_NAME FROM PA0001
WHERE PERNR = LT_OUTTAB2-PERNR.
ENDSELECT.
SELECT SSSNO INTO S_SSS FROM PA0422
WHERE PERNR = LT_OUTTAB2-PERNR.
ENDSELECT.
IF P_CTYP = 'SS'.
S_TEXT1 = 'CERTIFICATE OF SSS PREMIUM CONTRIBUTION'.
S_TXT = 'SSS# :'.
ENDIF.
AT END OF PERNR.
GV_PERNR = GS_OUTTAB-PERNR.
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
FORMNAME = 'ZHRPYHPHRSBR0_V2'
IMPORTING
FM_NAME = FNAME.
IF SY-SUBRC EQ 0.
ENDIF.
CALL FUNCTION FNAME
EXPORTING
OUTPUT_OPTIONS = GS_SSFCOMPOP
S_TEXT1 = S_TEXT1
S_TXT = S_TXT
S_NAME = S_NAME
S_SSS = S_SSS
S_RYEAR = S_RYEAR
S_RMNTH = S_RMNTH
S_ISSDATE = S_ISSDATE
S_REC = S_REC
S_EECTB = S_EECTB
S_ERCTB = S_ERCTB
S_TOT = S_TOT.
IF SY-SUBRC EQ 0.
ENDIF.
ENDAT.
ENDLOOP.
very honestly i did not get ur question..... u have done all of ur logic in driver program is fine...no issues.....
but what do you mean by that you cannot creta a loop in smartform.....
see you must have gathered all your data into an internal table.....
within the smartform you define a table and add your internal table name in the data section of the table...you would also need a work arrea...define line type etc.....you dont need to create a loop statement manually...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi...
sorry it seems my query confuse you....
what i mean in my query is... i created a drivers program that display employees contributions example loan payment via smartforms. in order for me to generate smartform display i pass all the data in itab LT_OUTTAB2 like this.
S_RMNTH = LT_OUTTAB2-RMNTH.
S_RYEAR = LT_OUTTAB2-RYEAR.
S_ISSDATE = LT_OUTTAB2-ISSDATE.
S_REC = LT_OUTTAB2-RECEIPT.
S_EECTB = LT_OUTTAB2-EECTB.
S_ERCTB = LT_OUTTAB2-ERCTB.
S_ECCTB = LT_OUTTAB2-ECCTB.
S_TOT = LT_OUTTAB2-TOTAL.
S_GTOT3 = S_TOT + S_GTOT3.
S_GTOT2 = S_ERCTB + S_GTOT2.
S_GTOT1 = S_EECTB + S_GTOT1.
Then i call CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'.
But when i execute the program i only generate 1 data entry thats why i need to add LOOP in my smartform in case i have gather multiply entry in order for me to display them all.
Hi,
You have to use tables options in the smartform there you can loop on the internal table into a workarea and then write the details using workarea.
You van create a table in the smartform by left clicking on the hierchy and choosing to create a table. I would suggest you should some more about how to use tables in smartform before you start your changes.
Regards,
Himanshu
hi
Check The below links which will help u creating Tables and how to use LOOPS in Smartforms....
http://help.sap.com/erp2005_ehp_04/helpdata/EN/4b/83fb48df8f11d3969700a0c930660b/frameset.htm
https://wiki.sdn.sap.com/wiki/display/Snippets/Smartform-Howtoavoidthedialog+box
Surya
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.