‎2007 Jan 04 4:55 PM
Hi ,
i developed the SAPscript for PO and created the output type by assigning the access sequence. Now the problem when creating or changed the PO if the net amount is more than 5000 then it has to print and if it is less than 5000 then sapscript need to print.
1. can i assign the same print program(standrd) and SAPscript in one output type with different media
2. where to shift the output media based on the total item value LS or GT 5000. Is it possible to switch the output media.
Regards,
Challa
‎2007 Jan 04 5:51 PM
Hi,
Okay..If it is a standard sap print program..
Try this solution..
1)
Create two output types..One for fax and one for print output..
Assign these output types to the same procedure..
2)
Have two new vofm routines..
In one routine..Propose the output type if the net value is greater than 5000.
In another routine..Propose the output type if the net value is lesser than 5000.
Thanks,
Naren
‎2007 Jan 04 5:02 PM
Hi,
Both greater than and less than looks like the same
<b>PO if the net amount is more than 5000 then it has to print and if it is less than 5000 then sapscript need to print.</b>
Thanks,
Naren
‎2007 Jan 04 5:16 PM
If it is less than 5000 then it has to fax and if it is grater than 5000 it has to print.
Regards,
Challa
‎2007 Jan 04 5:27 PM
Hi,
Try this solution..
In the print program..
Check if the value is greater than 5000
Then change the ITCPO structure accordingly...Use that when calling the FM OPEN_FORM
Populate the following structure for the fax..
ITCPO-tdteleland = 'Country'
ITCPO-tdtelenum = 'Fax number'
LVF_DEVICE = 'TELEFAX'.
LVS_ITCPO-TDSENDDATE = NAST-VSDAT.
LVS_ITCPO-TDSENDTIME = NAST-VSURA.
LVS_ITCPO-TDFAXUSER = NAST-USNAM.
CALL FUNCTION 'OPEN_FORM'
EXPORTING
DEVICE = LVF_DEVICE
DIALOG = ' '
FORM = TNAPR-FONAM
LANGUAGE = NAST-SPRAS
OPTIONS = LVS_ITCPO
Thanks,
Naren
‎2007 Jan 04 5:38 PM
Thank you,
But i am using the standard print program and i need to control output meida while saving or changing the PO. Is it posible to contarol in routines or in user exit.
while saving or creating time the output type will be determine at this point i would like to chnage the media based on the above condition.
Regards,
naidu
‎2007 Jan 04 5:51 PM
Hi,
Okay..If it is a standard sap print program..
Try this solution..
1)
Create two output types..One for fax and one for print output..
Assign these output types to the same procedure..
2)
Have two new vofm routines..
In one routine..Propose the output type if the net value is greater than 5000.
In another routine..Propose the output type if the net value is lesser than 5000.
Thanks,
Naren
‎2007 Jan 04 5:55 PM
Create two output types..One for fax and one for print output..
Assign output types to the same procedure..
Have two new VOFM routines..
In one routine the output type is print if the net value is greater than 5000.
In other routine the output type is fax if the net value is less than 5000.
‎2007 Jan 04 6:12 PM
Hi,
I will reward the points but last question is the net value available for routines or i have select from EKPO and sum all the net values of items.
Regards,
Challa
‎2007 Jan 04 6:34 PM
Hi,
Since the NETWR field is not available in the EKKO table..you have to get the value from the memory..
Example code to get the net value
-
FIELD-SYMBOLS <fs_komp> TYPE KOMP.
data: lv_field(50).
lv_field = '(SAPLMEPO)KOMP'.
ASSIGN (lv_field) TO <fs_komp>.
if sy-subrc ne 0.
lv_field = '(SAPMM06E)KOMP'.
ASSIGN (lv_field) TO <fs_komp>.
IF SY-SUBRC <> 0.
EXIT.
ENDIF.
endif.
Check the net value
IF <FS_KOMP>-NETWR > '5000'.
SY-SUBRC = 0.
ELSE.
SY-SUBRC = 4.
ENDIF.
Hope this helps..
Thanks,
Naren
‎2007 Jan 04 7:51 PM
It was very help full
My last question can't we consolidate two output types into one and change the media ( fax or print).
Regards,
Naidu
‎2007 Jan 04 7:53 PM
Hi,
If we can change the print program..Then we can try changing the NAST structure..
If not ..I am not sure how to do it one output type..
Thanks,
Naren
‎2007 Jan 05 11:08 PM
Hi Narendran,
I have created to out put types and assigned to the same procedure.
Then created two routines and assigned to above two output types.
In this case it is taking print out output type workign fine but fax one is praposing.
could please tell me if i am doing any wrong.
Note: i have created one outtype and copied the same to created the second output type.
‎2007 Jan 05 11:11 PM
Hi,
Did you add the code to the routines..
Please post the code that you have in both the routines..
Thanks,
Naren
‎2007 Jan 06 12:51 AM
Hi
It is working fine now. I missed in doing fine tuning for purchase order.
Thank you very much for you help.
Regards,
challa
‎2007 Jan 06 1:03 AM