‎2005 Aug 27 6:58 AM
In check printing i am getting a dump saying that the actual parameter is 670bytes long and formal parameter is 2278bytes.
The code is
PERFORM EXTRACT IN PROGRAM ZSUBROUTINE1
USING ®UH-VBLNR&
USING ®UD-SWNES&
ENDPERFORM
®UD-SWNES&
FORM EXTRACT TABLES IN_PAR STRUCTURE REGUH OUT_PAR STRUCTURE REGUD.
DATA : BILL_NO LIKE REGUH-VBLNR.
DATA : ITAB LIKE REGUP OCCURS 0 WITH HEADER LINE.
DATA : JTAB LIKE REGUP OCCURS 0 WITH HEADER LINE.
DATA : BELNR1 LIKE ITAB-BELNR.
DATA : QBSHB1 LIKE REGUD-SWNES.
DATA : QBSHB2 LIKE REGUD-SWNES.
DATA : TOTOQBSHB LIKE REGUD-SWNES.
READ TABLE IN_PAR WITH KEY VBLNR = 'REGUH-VBLNR'.
BILL_NO = IN_PAR-VBLNR.
SELECT * FROM REGUP INTO CORRESPONDING FIELDS OF TABLE ITAB WHERE VBLNR
= BILL_NO.
READ TABLE ITAB INDEX 1.
IF SY-SUBRC = 0.
MOVE ITAB-QBSHB TO QBSHB1.
MOVE ITAB-BELNR TO BELNR1.
ENDIF.
SELECT * FROM BSEG INTO CORRESPONDING FIELDS OF TABLE JTAB WHERE BELNR
= BELNR1.
LOOP AT JTAB.
READ TABLE JTAB INDEX SY-TABIX.
IF SY-SUBRC = 0.
QBSHB2 = QBSHB2 + JTAB-QBSHB.
ENDIF.
ENDLOOP.
TOTOQBSHB = QBSHB1 + QBSHB2.
READ TABLE OUT_PAR WITH KEY SWNES = 'REGUD-SWNES'.
CLEAR REGUD.
MOVE TOTOQBSHB TO OUT_PAR-SWNES.
ENDFORM.
‎2005 Aug 27 9:06 AM
Hi,
I think your FORM declararion should be like
FORM <form> TABLES IN_TAB STRUCTURE ITCSY
OUT_TAB STRUCTURE ITCSY.
Please try this.
Thanks
Vinod
‎2005 Aug 27 9:43 AM
An example you can find at
http://help.sap.com/saphelp_46c/helpdata/en/d1/803279454211d189710000e8322d00/content.htm
‎2005 Aug 27 9:39 AM
Your definition of routine is wrong, but it'll be like this:
FORM EXTRACT TABLES IN_TAB STRUCTURE ITCSY
OUT_TAB STRUCTURE ITCSY.
ENDFORM.
The strutcute ITCSY have two field where you can find the name and value of your variable.
So your code'll be like that:
DATA : BILL_NO LIKE REGUH-VBLNR.
READ TABLE IN_TAB WITH KEY FIELD = 'REGUH-VBLNR'.
IF SY-SUBRC = 0.
MOVE IN_TAB-VALUE TO BILL_NO.
Here you can probably use a convert routine to get out the right value (for example ALPHA).
SELECT * FROM REGUP INTO CORRESPONDING FIELDS OF TABLE ITAB WHERE VBLNR
= BILL_NO.
.........
ENDIF.
When you want to get out a value:
READ TABLE out_TAB WITH KEY FIELD = 'MY_FIELD'.
IF SY-SUBRC = 0.
MOVE <VALUE> TO OUT_TAB-VALUE.
MODIFY OUT_TAB INDEX SY-TABIX.
ENDIF.
‎2005 Aug 27 10:38 AM
Hi Mave,
If your question is answered please close the thread and reward accordingly.
Thanks
Vinod
‎2005 Aug 27 3:42 PM
Hi Mave,
The problem you have is because you defined your form as receiving two TABLE parameters, while your perform statement is passing USING parameters ®UH-VBLNR& and ®UD-SWNES&. Either change your perform call passing tables to the call or change your FORM removing the TABLES parameters and adding USING parameters.
Please reward and close the post if answered.
Srinivas