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: 

Data availability in SAP Script.

0 Kudos

Hi Experts,

I have a requirement to add new page to my custom SAP Script with some additional data. Structure "HRPAYCHLAW_OUTPUT" was enhanced with additional fields and those fields were populated using BADI implementation for BADI "HRPAYCHLAW2(HR-CH: Wage Statement 2005).

Method "Print" for class "CL_HRPAYCH_LAW" was enhanced to call newly added page with following code.

     CALL FUNCTION 'END_FORM'.     "End of printing page BEIBLATT

     CALL FUNCTION 'START_FORM'    "Start a new page
     EXPORTING
       Startpage = 'TAXCONLT'.     "Direct access to page TAXCONLT for tax confirmation letter.

*    lw_output = a_output.

     CALL FUNCTION 'WRITE_FORM'
     EXPORTING
       Window = 'HEADERTL'.        " Window to print Header information for TAX confirmation letter.

     CALL FUNCTION 'WRITE_FORM'
     EXPORTING
       element = 'TAXLETTER'
       Window = 'MAINTL'.

     CALL FUNCTION 'END_FORM'.     "End of printing page TAXCONLT for tax confirmation letter.

Now the issue is availability for Data inside this Form. Structure a_output holding data is not available inside WRITE FORM. Request your inputs how to pass the values to FORM.

3 REPLIES 3

nabheetscn
Active Contributor
0 Kudos

Hi Hemant

In your sap script which variables are you using to Display the output? If you are using A_OUTPUT it will work ...

Nabheet

0 Kudos

Hi Nabheet,

Thanks for your reply.

I am using A_OUTPUT for displaying values, but inside write forms the structure values are blank and when I return back to enhancement values are in the structure.

0 Kudos

Issue is resolved now. Data was cleared in structure HRPAYCHLAW_OUTPUT when following statement was executed.

CALL FUNCTION 'END_FORM'.     "End of printing page BEIBLATT

It is working with the following code:-

* Start second page

  CALL FUNCTION 'CONTROL_FORM'

    EXPORTING

      command = 'NEW-PAGE TAXCONLT'.

CALL FUNCTION 'WRITE_FORM'
EXPORTING
  element = 'TAXLETTER'
  Window = 'MAINTL'
EXCEPTIONS
  OTHERS = 01.

Thanks.

Hemant Singh Bisht