Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Output control

Former Member
0 Likes
1,739

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

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,639

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

14 REPLIES 14
Read only

Former Member
0 Likes
1,639

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

Read only

0 Likes
1,639

If it is less than 5000 then it has to fax and if it is grater than 5000 it has to print.

Regards,

Challa

Read only

Former Member
0 Likes
1,639

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

Read only

0 Likes
1,639

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

Read only

Former Member
0 Likes
1,640

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

Read only

Former Member
0 Likes
1,639

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.

Read only

0 Likes
1,639

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

Read only

Former Member
0 Likes
1,639

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

Read only

0 Likes
1,639

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

Read only

Former Member
0 Likes
1,639

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

Read only

0 Likes
1,639

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.

Read only

Former Member
0 Likes
1,639

Hi,

Did you add the code to the routines..

Please post the code that you have in both the routines..

Thanks,

Naren

Read only

0 Likes
1,639

Hi

It is working fine now. I missed in doing fine tuning for purchase order.

Thank you very much for you help.

Regards,

challa

Read only

Former Member
0 Likes
1,639

Hi,

You are most welcome..

Thanks,

Naren