on 02-02-2007 9:35 PM
Hi All,
Acc. to My Requirements.
if there is no batch number a line ________ has to print by the sap script form,material handlers will use this line to write manually.
For this what I did in the script main window is
/: perform batch_line in program zwm_get_line
/:using <ap-charg&
/:changing &gv_charg&
/:endperform
and the subroutine pool zwm_get_line.
data: gv_batch like ltap-charg
if gv_batch is initial
gv_batch = '__________'
end if.
But I am not getting this in a correct way.Can you help me out kindly to solve this problem.
Thanks in Advance,
Praveen
HI Praveen,
u can use flag in subroutine..
read flag in script and print line..
<b>/: perform batch_line in program zwm_get_line
/:using <ap-charg&
/:changing &gv_charg&
/:endperform
/: IF &GV_CHARG& EQ 'X'
PR &ULINE(70)&
/: ENDIF</b>
and the subroutine pool zwm_get_line.
<b>data: gv_batch like ltap-charg.
data: batch_flg type boolean.
READ TABLE tab_in WITH KEY 'LTAP-CHARG'.
IF sy-subrc = 0.
GV_BATCH = TAB_IN-VALUE.
ENDIF.
if GV_BATCH is initial
batch_flg = 'X'.
ELSE.
CLEAR BATCH_FLG.
ENDIF.
READ TABLE TAB_OUT WITH KEY 'GV_CHARG'.
IF SY-SUBRC = 0.
TAB_OUT-VALUE = BATCH_FLG.
ENDIF.
MODIFY TAB_OUT INDEX SY-TABIX.</b>
FYI: u can use same perform and subroutine for this query and for your previous query.
like...
/: PERFORM......
/: USING <AP-MATNR&
/:USING <AP-CHARG&
/: CHANGING &GV_MATNR&
/: CHANGING &GV_CHARG&
/: ENDPERFORM.
SAME AS SUBROUTINE..
Regards
SAB
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
HI praveeen,
i guess ur output is like....
Item # matnr batch storage type source bin
1 3423523 3254235 dsfs dsfs
2 23434 ______ sdfsdf dsfsdfssd
if this is ur requirement.... then
i hope u given Tabs in paragraph format to align the columns...
then give like ..
<b>/: perform batch_line in program zwm_get_line
/:using <ap-charg&
/:changing &gv_charg&
/:endperform</b>
<b>/: IF &GV_CHARG& EQ 'X'
PR &item#&,,&matnr&,,&uline(5)&,,&storagetype&,,&sourcebin&
/: ELSE
PR &item#&,,&matnr&,,&batch&,,&storagetype&,,&sourcebin&
/: ENDIF</b>
PR - Paragraph format
,, - Tab space
and the subroutine pool zwm_get_line.
<b>
data: gv_batch like ltap-charg.
data: batch_flg type boolean.
READ TABLE tab_in WITH KEY 'LTAP-CHARG'.
IF sy-subrc = 0.
GV_BATCH = TAB_IN-VALUE.
ENDIF.
if GV_BATCH is initial
batch_flg = 'X'.
ELSE.
CLEAR BATCH_FLG.
ENDIF.
READ TABLE TAB_OUT WITH KEY 'GV_CHARG'.
IF SY-SUBRC = 0.
TAB_OUT-VALUE = BATCH_FLG.
ENDIF.
MODIFY TAB_OUT INDEX SY-TABIX.</b>
Regards
SAB
HI praveen,
I dont see any mistake in code... it is working fine by me...
i hope u r using the subroutine same as in the script routine.
small changes i made it in bold...
/: perform batch_line in program zwm_get_line
/:using <ap-charg&
/:changing &gv_charg&
/:endperform
/: IF &GV_CHARG& EQ 'X'
PR &item#&,,&matnr&,,&uline(5)&,,&storagetype&,,&sourcebin&
/: ELSE
PR &item#&,,&matnr&,,&batch&,,&storagetype&,,&sourcebin&
/: ENDIF
PR - Paragraph format
,, - Tab space
and the subroutine pool zwm_get_line.
data: gv_batch like ltap-charg.
data: batch_flg type boolean.
<b>FORM batch_line TABLES tab_in STRUCTURE itcsy
tab_out STRUCTURE itcsy.</b>
READ TABLE tab_in WITH KEY 'LTAP-CHARG'.
IF sy-subrc = 0.
GV_BATCH = TAB_IN-VALUE.
ENDIF.
if GV_BATCH is initial
batch_flg = 'X'.
ELSE.
CLEAR BATCH_FLG.
ENDIF.
READ TABLE TAB_OUT WITH KEY 'GV_CHARG'.
IF SY-SUBRC = 0.
TAB_OUT-VALUE = BATCH_FLG.
ENDIF.
MODIFY TAB_OUT INDEX SY-TABIX.
<b>endform.</b>
If the if sy-subrc = 0 giving error check the previos query how u executed it and provide same details.
subroutine will be same... as in script routine...
<b>If it doesn't work then paste ur whole subroutine code... so can check and help u.
</b>
<b>If it doesn't work then paste ur whole subroutine code... so can check and help u.
</b>
<b>If it doesn't work then paste ur whole subroutine code... so can check and help u.
</b>
Regards
SAB
Message was edited by:
Syed A
Hi Praveen,
just do this way
: IF &GV_CHARG& is initial.
&ULINE(70)&
/: ENDIF
Thats it why are you writing perform and all those things.
Thanks
Vikranth Khimavath
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
101 | |
13 | |
13 | |
11 | |
11 | |
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.