cancel
Showing results for 
Search instead for 
Did you mean: 

How to Call Standard PO Form in my Z program

Former Member
0 Kudos

Hi All,

Could you please tell me, How to Call the Standard PO form in my Z program for print priview and printing.

My requirement is :

Create Z program with PO Number as Selection screen.When we give the PO Number and Press execute it will show the print priview with printer option.

Thanks & Regards

Murali

Accepted Solutions (0)

Answers (6)

Answers (6)

Former Member
0 Kudos
Former Member
0 Kudos

Hi Lakshmi,

Thanks for quick reply.

Thanks...

Muirali.

Former Member
0 Kudos

Hi All,

Already i have Standard Script for PO.

But my problem is i want to develop one Z program which is having the PO Number (Parameter) as selection screen field and when iam giving PO Number and press F8 it will give the print priview of my standard PO Script.

Thanks & Regards

Murali.

Former Member
0 Kudos

hey if u want ot create a new smartform then tell me i will give u all details. from start to end.

Former Member
0 Kudos

Plz refer this.

REPORT ZPPR_BOM1.

&----


  • TABLES

&----


TABLES : MAST. " Material to BOM Link

&----


*& Internal tables Begin with it_

&----


DATA : IT_MAST TYPE MAST OCCURS 0 WITH HEADER LINE.

DATA: fm_name TYPE rs38l_fnam.

CLEAR : IT_MAST.

REFRESH : IT_MAST.

&----


*& Parameters Begin with pr_

*& Select-options Begin with so_

&----


SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.

PARAMETERS: PR_MATNR LIKE MAST-MATNR OBLIGATORY,

PR_WERKS LIKE MAST-WERKS OBLIGATORY.

SELECTION-SCREEN END OF BLOCK b1.

SELECT * FROM MAST INTO TABLE IT_MAST " Get BOM number

WHERE MATNR = PR_MATNR

AND WERKS = PR_WERKS.

CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'

EXPORTING

formname = 'ZPPS_BOM1'

IMPORTING

fm_name = fm_name.

CALL FUNCTION fm_name "'/1BCDWB/SF00000079'

  • EXPORTING

  • ARCHIVE_INDEX =

  • ARCHIVE_INDEX_TAB =

  • ARCHIVE_PARAMETERS =

  • CONTROL_PARAMETERS =

  • MAIL_APPL_OBJ =

  • MAIL_RECIPIENT =

  • MAIL_SENDER =

  • OUTPUT_OPTIONS =

  • USER_SETTINGS = 'X'

  • IMPORTING

  • DOCUMENT_OUTPUT_INFO =

  • JOB_OUTPUT_INFO =

  • JOB_OUTPUT_OPTIONS =

TABLES

IT_MAST = it_mast

  • EXCEPTIONS

  • FORMATTING_ERROR = 1

  • INTERNAL_ERROR = 2

  • SEND_ERROR = 3

  • USER_CANCELED = 4

  • OTHERS = 5

.

IF SY-SUBRC <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

Former Member
0 Kudos

There is no Standard Smartform for PO , standard calls a script. U will have to develop ur own smartform if u need a smartform instead of script.

Former Member
0 Kudos

if it is smartform

call function 'SSF_FUNCTION_MODULE_NAME'

exporting

formname = lf_formname " Standard PO Form

importing

fm_name = lf_fm_name

exceptions

no_form = 1

no_function_module = 2

others = 3.

if it is script

CALL FUNCTION 'OPEN_FORM'

CALL FUNCTION 'START_FORM'

CALL FUNCTION 'WRITE_FORM'

CALL FUNCTION 'END_FORM'.

CALL FUNCTION 'CLOSE_FORM'.

Former Member
0 Kudos

Process the output type of the po form thru ur program,

check my wiki on how to do it https://wiki.sdn.sap.com/wiki/display/ABAP/ProcessOutputtypesthroughprogram

in the code given in wiki just pass the output type and wa_nast objky as po number that u get from selection screen

кu03B1ятu03B9к

Former Member
0 Kudos

Hi Kartik,

How can we know for different POs

1) Apllication area

2) Output type(Message type) KSCHL

3) Message Partner

4) Partner Role

5) Message Transmission medium

6) Dispatch time

Thanks & Regards

Murali

Former Member
0 Kudos

Hi,

You get all these details from Table NAST.

Regards,

Rishikesh

Former Member
0 Kudos

HI

@Rishikesh

You can only find it in NAST if an message has already been created.

Gr., Frank