Skip to Content
0
Former Member
Aug 05, 2010 at 10:03 AM

Tabstrip and Form Printing - Help Needed!!!

19 Views

Hi Experts!

I have two tabstrips, and i have attached a subscreen with this control. In subscreen I have a two table controls one for first tab strip and for second tab strip as well. I have attached a smartform with this control, form is triggered when the Print button is pressed.

What i want to do is, I want to print the form based on which tab strip is active. Like if first tab strip is active I want to print the data of the first tabstrips table control, similarly i want to do it with the second tab strip. If user enter data in both tab strips then it should print the data the of both the controls based on which tabstrip is selected.

I have tried it, but it loads the data which is entered first irrespective of the selected tabstrip.

Here is the code I am trying

Here i am setting the sy-ucomm value for each tabstrip.

 IF sy-ucomm = 'TESTTAB'. " first tab strip
    reffstrip-activetab = sy-ucomm.
  ELSEIF sy-ucomm = 'REFFTAB'. " second tab strip
    reffstrip-activetab = sy-ucomm .
  ENDIF.

Here i am printing the form.

DATA: lf_formname TYPE tdsfname.
DATA: lf_fm_name  TYPE rs38l_fnam.

  wa_cparam-no_dialog = 'X'.
  wa_cparam-preview = 'X'.
  wa_output-tddest = 'LP01.'.

  lf_formname = 'ZHC_REFFERAL_LETTER'.

  CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
    EXPORTING
      formname           = lf_formname
    IMPORTING
      fm_name            = lf_fm_name
    EXCEPTIONS
      no_form            = 1
      no_function_module = 2
      OTHERS             = 3.
  CALL FUNCTION lf_fm_name
    EXPORTING
      str_test           = str_test
      str_cp             = str_cp
      control_parameters = wa_cparam
      output_options     = wa_output
      user_settings      = space
    TABLES
      itab_exam          = itab_exam
      itab_letters       = itab_letters
      itab_medicine      = itab_medicine.

Please help me.