To print Transfer Order using smart forms instead of SAP script

...Previous

Go to the function exit and write the custom logic in the custom include   INCLUDE ZXDRUU01” as per follows:  

Code Snippet:

*local variable declaration.
  
DATA: lw_fm_name            TYPE rs38l_fnam.

* Local Field Symbols
  
FIELD-SYMBOLS : <l_fs_rldri> TYPE rldri.

* Local Constant declaration
  
CONSTANTS : lc_formname TYPE tdsfname   VALUE 'ZTEST_FORM',
              lc_chk      
TYPE rldrudruck VALUE 'X'.

*Moving Transfer Order Print :Item level data into corresponding work
*area.
  
LOOP AT xrldri ASSIGNING <l_fs_rldri>.

* Determine smartform function module 
    
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
      
EXPORTING
        formname           
lc_formname
      
IMPORTING
        fm_name            
lw_fm_name
      
EXCEPTIONS
        no_form            
1
        no_function_module 
2
        
OTHERS             3.

    
IF sy-subrc 0.
* Call the function module of the smartform
      
CALL FUNCTION lw_fm_name
        
EXPORTING
          user_settings    
lc_chk
          tanum            
<l_fs_rldri>-tanum
          lgnum            
<l_fs_rldri>-lgnum
        
EXCEPTIONS
          formatting_error 
1
          internal_error   
2
          send_error       
3
          user_canceled    
4
          
OTHERS           5.
      
IF sy-subrc 0.
      
ENDIF.
    
ENDIF.
  
ENDLOOP."LOOP AT lt_rldri1 ASSIGNING <l_fs_rldri>.  

After writing the custom logic that includes calling of smart form activate the function exit

And activate the project.  

Create the smart form ‘ZTEST_FORM’.  

In the form Interface add two import parameters LGNUM and TANUM  

Create a text in the main window:  

Activate the smart form.  

Output:  

Go to transaction LT31.  

 

P.S. If we use this function exit, anything entered in the configuration i.e. OMNU will not be considered any further.

Please send us your feedback/suggestions at webmaster@SAPTechnical.COM 

HomeContribute About Us Privacy Terms Of Use • Disclaimer • SafeCompanies: Advertise on SAPTechnical.COM | Post JobContact Us  

Graphic Design by Round the Bend Wizards

footer image footer image