Making subform behave as table and data part as body row

...Previous

Step14: Giving bindings to each of the subforms.

Table Binding: YDEMO_SUBFORMS->IT_SFLIGHT. 

 

Bodyrow Binding: YDEMO_SUBFORMS->IT_SFLIGHT->DATA. The checkbox repeat subform for each data item has to be checked giving Min.Count = 1.

 

Step15: Save and activate the form. 

Step16: Creating a Driver Program which will call the form and on execution will display the adobe form. 


*&---------------------------------------------------------------------*
*& Report  yh_demo                                                     *
*&---------------------------------------------------------------------*
*&Purpose: Demonstrating driver program to display adobe form          *
*&---------------------------------------------------------------------*
REPORT  yh_demo.
*Data Declarations
DATA : it_sflight TYPE sflight_tab1.
DATA :
  w_doc_param       TYPE sfpdocparams,"Doc Parameters
  w_output_param    TYPE sfpoutputparams,
                                       "Output Parameters
  result            TYPE sfpjoboutput. "Joboutput
DATA :
  fm_name    TYPE rs38l_fnam.          "Function Module name
* Determine print data, Data which will be displayed on the form
SELECT * FROM sflight
         INTO TABLE it_sflight
         UP TO 20 ROWS.
IF sy-subrc NE 0 .
ENDIF.
* Determine the function module which is generated at the runtime for
* the pdf form used
CALL FUNCTION 'FP_FUNCTION_MODULE_NAME'
  EXPORTING
    i_name     = 'YDEMO_SUBFORMS'
  IMPORTING
    e_funcname = fm_name.
* This function module is used to specify settings for the form output.
* To specify whether you want the form to be printed, archived, or sent
* back to the application program as a PDF.
* The form output is controlled using the parameters (w_ouput_param)
* with the type SFPOUTPUTPARAMS.
CALL FUNCTION 'FP_JOB_OPEN'
  CHANGING
    ie_outputparams = w_output_param
  EXCEPTIONS
    cancel          = 1
    usage_error     = 2
    system_error    = 3
    internal_error  = 4
    OTHERS          = 5.
IF sy-subrc <> 0.
  MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
          WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
* Set the language field the component of structure /1bcdwb/docparams
w_doc_param-langu = 'EN'.
* Call the function module and passing the form interface values
CALL FUNCTION fm_name
  EXPORTING
   /1bcdwb/docparams         = w_doc_param
    it_sflight               = it_sflight
* IMPORTING
*   /1BCDWB/FORMOUTPUT       =
 EXCEPTIONS
   usage_error              = 1
   system_error             = 2
   internal_error           = 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.
* To complete the processing of the form
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.
  MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
          WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.

Step17: Activating the report and executing it would pop a window. 

 

Give the device name which is configured for ADS. Click on Print Preview to see the preview of the form.

The form output

Page 1:

 

Page2:

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