Adding rows dynamically in a table using interactive Adobe Forms

...Previous

REPORT  ZOFFLINE_MAT_01.

data:
  fs_venbank 
type zwd_mat,
  it_mat     
type zwd_t_mat,
  l_fm_name         
TYPE rs38l_fnam,
  l_formname        
TYPE fpname VALUE 'ZOFFLINE_MAT_FORM',
  fp_docparams      
TYPE sfpdocparams,
  FP_FORMOUTPUT     
TYPE FPFORMOUTPUT,
  fp_outputparams   
TYPE sfpoutputparams.

START-
OF-SELECTION.
  
PERFORM get_function_module.
*&---------------------------------------------------------------------*
*&      Form  GET_FUNCTION_MODULE
*&---------------------------------------------------------------------*

form GET_FUNCTION_MODULE .
  
CALL FUNCTION 'FP_FUNCTION_MODULE_NAME'
    
EXPORTING
      i_name     = l_formname
    
IMPORTING
      e_funcname = l_fm_name.
*   E_INTERFACE_TYPE           =

*  fp_outputparams-nodialog = 'X'.
*  fp_outputparams-getpdf   = 'X'.

  
CALL FUNCTION 'FP_JOB_OPEN'
    
CHANGING
      ie_outputparams = fp_outputparams
    
EXCEPTIONS
      cancel          = 
1
      usage_error     = 
2
      system_error    = 
3
      internal_error  = 
4
      
OTHERS          = 5.
  
IF sy-subrc <> 0.
    
CASE sy-subrc.
      
WHEN OTHERS.
    
ENDCASE.                           " CASE sy-subrc
  
ENDIF.

  fp_docparams-langu = 
'X'.
  fp_docparams-
country = 'US'.
  fp_docparams-fillable = 
'X'.

  fp_docparams-dynamic  = 'X'.  

CALL FUNCTION l_fm_name
    
EXPORTING
      /1bcdwb/docparams  = fp_docparams
      zmat               = it_mat
    
IMPORTING
      /1BCDWB/FORMOUTPUT = FP_FORMOUTPUT
    
EXCEPTIONS
      usage_error        = 
1
      system_error       = 
2
      internal_error     = 
3
      
OTHERS             = 4.

  
IF sy-subrc <> 0.
    
CASE sy-subrc.
      
WHEN OTHERS.
    
ENDCASE.                           " CASE sy-subrc
  
ENDIF.                               " IF sy-subrc <> 0

  
CALL FUNCTION 'FP_JOB_CLOSE'
*   IMPORTING
*     E_RESULT             = result
   
EXCEPTIONS
     usage_error          = 
1
     system_error         = 
2
     internal_error       = 
3
     
OTHERS               = 4
             .
  
IF sy-subrc <> 0.
    
CASE sy-subrc.
      
WHEN OTHERS.
    
ENDCASE.                           " CASE sy-subrc
  
ENDIF.                               " IF sy-subrc <> 0.
endform.                    " GET_FUNCTION_MODULE
 

Note: To add the rows dynamically in the form, we have to pass the value ‘X’ to parameter DYNAMIC of the structure /1BCDWB/DOCPARAMS.  

Output: execute the program  

Now when you click on button Insert, a new row will be added after 3 rows.  

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