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

Get Print Parameters

Former Member
0 Likes
2,709

The Get_Print_Parameters , if called with parameters as :

CALL FUNCTION 'GET_PRINT_PARAMETERS'

EXPORTING MODE = 'BATCH'

REPORT = 'SDBILLDL'

LAYOUT = 'ZLAY-TST'

IMPORTING OUT_PARAMETERS = PARAMS

VALID = VALID.

get the settings for the layout specified in the Parameter. I tried this and it says the layout is not defined for so and so printer , when i go and see the F4 for layouts it actually pops up the format(X_jjj) not the layout that i have defined and passed in the paramaeter.

Is there any way that we can run a report with a layout , the way we can run it with variant ?? If not then what is the use of layout ?

4 REPLIES 4
Read only

Former Member
0 Likes
1,596

Hi,

Check this sample code...

report ztest_print.

  DATA:L_PARAMS TYPE PRI_PARAMS,
       L_VALID TYPE C.

    CALL FUNCTION 'GET_PRINT_PARAMETERS'
       EXPORTING
         IMMEDIATELY                  = ' '
       <b>  LINE_SIZE                    = 220</b>         RELEASE                      = 'X'
         MODE                         = 'CURRENT'
         NO_DIALOG                    = ' '
       IMPORTING
*     OUT_ARCHIVE_PARAMETERS       =
         OUT_PARAMETERS               = L_PARAMS
         VALID                        = L_VALID
       EXCEPTIONS
         ARCHIVE_INFO_NOT_FOUND       = 1
         INVALID_PRINT_PARAMS         = 2
         INVALID_ARCHIVE_PARAMS       = 3
         OTHERS                       = 4.
      IF SY-SUBRC <> 0.

      ENDIF.
"But it will take default printer from user settings
      NEW-PAGE PRINT ON   PARAMETERS L_PARAMS NO DIALOG.
       write : 'print is on'.
      NEW-PAGE PRINT OFF.

Regards

vijay

Read only

Former Member
0 Likes
1,596

hi,

Check this code too

   CALL FUNCTION 'GET_PRINT_PARAMETERS'
       EXPORTING
         IMMEDIATELY                  = C_IMMEDIATELY
         LAYOUT                       = 'Z_48_144'
         LINE_COUNT                   = '48'
         LINE_SIZE                    = '144'
         NEW_LIST_ID                  = C_NEW_LIST_ID
         NO_DIALOG                    = SPACE
         RELEASE                      = 'X'
       IMPORTING
         OUT_PARAMETERS               = WK_PRIPAR
         VALID                        = W_VALID
       EXCEPTIONS
         ARCHIVE_INFO_NOT_FOUND       = 1
         INVALID_PRINT_PARAMS         = 2
         INVALID_ARCHIVE_PARAMS       = 3
         OTHERS                       = 4.
    IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.

Read only

Former Member
0 Likes
1,596

hi sap,

did u assign any value to the layout 'ZLAY-TST'?? before calling the FM GET_PRINT_PARAMETERS IF not in the popup u will get those values.

Read only

0 Likes
1,596

Yes , I did run the report , sorted the field as per the requirement and save the layout with this name . Now , when i got to RV60SBAT ( to run bill due list in Background ) report , goto->settings->layout->chose , it pops up the new layout that i created and the standard layout too .

But , when i go to the VF04 report and same path , it only shows the standard Layout not mine.

In the above code , As this report is scheduled as a background job and is a standard report , So , If i create a program that :

First Fetches the Layout (get_print_parameter) and then submit the job with those parameter , will it call the report and display it as per the layout ?