09-09-2014 6:26 AM
Hi friends,
I'm facing an issue in PO release strategy. I've to stop the user by not taking the print via print preview either the PO got released or not.The user has to do it only thru PO print program TCode...i.e., ME9F.
So, Pls post me your comments with some sample codes or examples by way to deactivate the print button both in print popup window and the print icon in application tool bar available thru print priview ouput screen.
Pls note...it should be done only in me21n,me22n,me23n and me29n tcodes.
Pls advise.
thanks & regards
Suresh
09-09-2014 7:26 AM
Hi Suresh,
Please check whether you can hide Print preview button by creating screen variants through SHD0.
Srivijay
09-09-2014 6:34 AM
Check your print program for Purchase order in NACE - Output types
There before calling the smartform function module, set
ls_output_options-TDNOPRINT = 'X'.
09-09-2014 6:55 AM
Thank you so much for quick reply,
Can you please elaborate it in detail. Because i am new to SAP. whether i need to write before SSF_FUNCTION_MODULE_NAME.
Regards,
Suresh
09-09-2014 8:00 AM
Yes, you need to give it before that.
First of all, hope you have found your print output program.
NACE - Application EF (PO) -> Output types -> For PO (Should be NEU) -> Processing Routines and double click on the print output program.
Before the call to SSF_FUNCTION_MODULE_NAME FM, set the print parameters to be passed in the smartform FM
CALL FUNCTION fm_name
EXPORTING
archive_index = toa_dara
archive_parameters = arc_params
control_parameters = ls_control_param
mail_recipient = ls_recipient
mail_sender = ls_sender
output_options = ls_output_options
Here in the ls_output_options, disable print button by setting ls_output_options-TDNOPRINT = 'X'.
09-09-2014 8:35 AM
Hi Friends,
I written the code like this......
ls_output_options-TDNOPRINT = 'X'.
CALL FUNCTION lf_fm_name
EXPORTING
archive_index = toa_dara
archive_parameters = arc_params
control_parameters = ls_control_param
mail_recipient = ls_recipient
mail_sender = ls_sender
output_options = ls_output_options
zxekko = l_doc-xekko " user_settings = ' '
zxpekko = l_doc-xpekko
Regards,
Suresh
09-09-2014 7:26 AM
Hi Suresh,
Please check whether you can hide Print preview button by creating screen variants through SHD0.
Srivijay
09-09-2014 2:48 PM
Please guide me how can i achive the SHD0 screen varient for ME21N to hide the Print Preview for unreleased PO.
Regards,
Suresh
09-09-2014 2:16 PM
If i maintained at SHD0 ,,,,can it be allow for the released PO's Print Preview.
Regards,
Suresh
09-10-2014 7:32 AM
Hi Suresh,
If you create variant in SHD0 it will static for all cases. And if you want enable/disable the button based on release stratergy you need to findout the appropriate exit and do the modification by adding authentications.
Also please find procedure below to create the variant.
1. ME23N screen before creating screen variant:
2. Go to SHD0 and create new variant:
3. Click on Print preview button:
4. Click on Menu fuctions:
5. Expant the Function key setting -> Click on Deactivate Funcation by selecting Print preview
6. Select check box For status.
7. Activate the variant.
8. Out put screen after creating the variant (Print preview button disabled).
Thanks,
Srivijay
09-10-2014 8:25 AM
Hi Friends,
Thanks for the support .
The problem got solved by the following code.
DATA : WA_EKKO TYPE EKKO.
SELECT SINGLE * from ekko into wa_ekko WHERE ebeln = L_nast-OBJKY.
if WA_EKKO-FRGKE = '1'.
Message 'The Selected PO not Released' TYPE 'I'.
* leave TO LIST-PROCESSING.
ENDIF.
but the new problem is ,,,,the T-Code is not giving any back option i,e F3 or SHIFT+F3 or F12.
and it is not allowing to release the PO in the same session.
Please suggest how can i Achieve it, we must go by entering /n in command prompt where all users can't know this.
Regards,
Suresh
09-10-2014 9:29 AM
Hi Suresh,
You can give message type as 'E'.
And if you want to display message as Information message then write the message statment as " Message 'The Selected PO not Released' TYPE 'E' DISPLY LIKE 'I'. " which will not allow user to go further for that process.
Regards,
Srivijay
09-10-2014 11:20 AM
Hi freinds,
The issue got resolved finally with the below code.Thanks for support.
SELECT SINGLE * from ekko into wa_ekko WHERE ebeln = L_nast-OBJKY.
if WA_EKKO-FRGKE = '1' .
CONCATENATE 'The PO " ' WA_EKKO-ebeln '" is not yet released' INTO TDNAME SEPARATED BY SPACE.
MESSAGE TDNAME TYPE 'S' DISPLAY LIKE 'E'.
EXIT.
ENDIF.
Thanks,
Suresh
02-23-2016 9:33 AM
02-23-2016 9:40 AM
Hi, Dear sam patil
sorry for the interruption, What u not understood in the below post.
I all ready given some code also. May i know where u Struck.
I hope in this post. They suggested two ways.
1)SHDO
2)Print button disabled, in driver program. What i suggested in the below post.