Application Development 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: 

ZRLB_INVOICE print 2 copies

Former Member
0 Kudos

Hi;

I made a copy of the RLB_INVOCE standard program to my Z program. I changed the line below "ls_composer_param-tdcopies = nast_anzal." and now i put 2 to print two copies.

Does this could work..? or there is other way to print 2 copies programatically?

  • ls_composer_param-tdcopies = nast_anzal.

ls_composer_param-tdcopies = 2.

IF NOT nast_tdarmod IS INITIAL.

nast-tdarmod = nast_tdarmod.

CLEAR nast_tdarmod.

ENDIF.

Thanks on advance.

David Fúnez

Corp. Mandofer

Tegucigalpa, Honduras

1 ACCEPTED SOLUTION

naimesh_patel
Active Contributor
0 Kudos

Call your FM in the loop for the number of copies like:

    DO NAST_ANZAL TIMES.
* In case of repetition only one time archiving
      IF SY-INDEX > 1 AND NAST-TDARMOD = 3.
        NAST_TDARMOD = NAST-TDARMOD.
        NAST-TDARMOD = 1.
        LS_COMPOSER_PARAM-TDARMOD = 1.
      ENDIF.
 
* call smartform invoice

      CLEAR LS_COMPOSER_PARAM-TDRECEIVER.

      CALL FUNCTION LF_FM_NAME
           EXPORTING
                      ARCHIVE_INDEX        = TOA_DARA
                      ARCHIVE_PARAMETERS   = ARC_PARAMS
                      CONTROL_PARAMETERS   = LS_CONTROL_PARAM
*                 mail_appl_obj        =
enddo.

3 REPLIES 3

naimesh_patel
Active Contributor
0 Kudos

Call your FM in the loop for the number of copies like:

    DO NAST_ANZAL TIMES.
* In case of repetition only one time archiving
      IF SY-INDEX > 1 AND NAST-TDARMOD = 3.
        NAST_TDARMOD = NAST-TDARMOD.
        NAST-TDARMOD = 1.
        LS_COMPOSER_PARAM-TDARMOD = 1.
      ENDIF.
 
* call smartform invoice

      CLEAR LS_COMPOSER_PARAM-TDRECEIVER.

      CALL FUNCTION LF_FM_NAME
           EXPORTING
                      ARCHIVE_INDEX        = TOA_DARA
                      ARCHIVE_PARAMETERS   = ARC_PARAMS
                      CONTROL_PARAMETERS   = LS_CONTROL_PARAM
*                 mail_appl_obj        =
enddo.

Former Member
0 Kudos

Hi David,

I guess it should print.

Regards,

Bharat.

Former Member
0 Kudos

solved