Quantcast
Channel: SCN : All Content - ABAP Development
Viewing all articles
Browse latest Browse all 8332

Adobeform for multiple trays

$
0
0

Adobeform for multiple trays

We have some printers with multiple trays. Depending on the message category, we can print adobeform from a specific tray. Rule will be always as simple i.e. for one message category; we know the tray number where we want to print the adobeform.

 

First we need, maintain data in TVARVC as below:

 

Go to Transaction STVARV and maintain the data for the Message Category and Tray Value.

 

1.jpg

 

Name contains the Message Category and the Value is Tray Name / Number (i.e. either for Duplex Printer or Simplex Printer)

 

Before calling the function module ‘FP_JOB_OPEN’, pass the value of the tray name or number in the field ‘JOB_PROFILE’ of the structure ‘SFPOUTPUTPARAMS’ i.e. form processing output parameter.

 

Code as below:

Taking example for Production Order (CO01/02/03)

 

Transaction OPK8

List Name

 

3.jpg

 

Driver Program: PSFC_OBJECT_LIST_PDF

Enhancement Spot at Form ‘FILL_OUTPUTPARAMS’.

 

2.jpg

DATA:        lv_messageo TYPE fpjobprofile,

                  lv_msgo     TYPE rvari_vnam.

 

CONSTANTS: lc_msg1 TYPE rvari_vnam VALUE 'ZFPP01_',

                     lc_msg2 TYPE rvari_vnam VALUE 'ZFPP02_'.

 

*-- Concatenate like 'ZFPP01_LG01ZP01'

*-- print_co-lstid contains value of list name i.e. LG01 and print_co-auart contains the value of Order Type i.e. ‘ZP01’, ‘ZP03’, etc.

CONCATENATE lc_msg1 print_co-lstid print_co-auart INTO lv_msgo.

 

*-- Select query to fetch the tray value from table 'TVARVC' comparing the Message Category

 

SELECT SINGLE low  "ABAP/4: Selection value (LOW)

INTO lv_messageo

FROM tvarvc "Table of Variant Variables (Client

WHERE name = lv_msgo

      AND type = lc_value_p.

IF sy-subrc EQ 0.

    xs_outputparams-job_profile = lv_messageo. " Populate the value of the Tray name in the field 'JOB_PROFILE'.

ENDIF.

 

This is how depending on the message category, print will come from a specific tray in the printer has multiple trays.

 

Thanks for reading the document.

 

Regards,

Debopriya Ghosh

 


Viewing all articles
Browse latest Browse all 8332

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>