cancel
Showing results for 
Search instead for 
Did you mean: 

Issues reg multiple scripts in a single driver program

former_member182465
Active Participant
0 Kudos

I have a requirement where 1st page should be in portrait and next pages should be in landscape. In landscape page I need to print 2 internal tables data.

So i created 2 scripts one in potrait and other in landscape.

So I have called open_form with script1(portrait).

Then start_form

Printed data with write_form

Then end_form

select data for 2 tables.

Then start_form = script2(landscape)

Loop at itab1 into wa1.

Printing data with write_form.

Endloop.

Then end_form.

Then close_form.

1) how to print header for 2 internal tables and table/ box dynamically.

2) When printing internal table 1(itab1) the 1st record is printing as many times the no of records in itab1. But when I am checking in debugger the work area1(wa1) data is getting refreshed with new values but those are not getting reflected in script.

Ex : data in internal table 1 (itab1)

100 hi

200 hk

But the output is as 100 hi

100 hi

May be thi is because of opening 2 scripts.

Accepted Solutions (0)

Answers (4)

Answers (4)

former_member182465
Active Participant
0 Kudos

Hi Archana,

The driver program is copy of RIPRCT00 - i.e plant maintenance order. In that the subroutine open_form had been moved after subroutine PERFORM TECH_OBJECT_PARTNER. Please have a glance on program RIPRCT00.

In perform open_form the changes are as below.

CALL FUNCTION 'OPEN_FORM'

xxxxx

CALL FUNCTION 'END_FORM'

.

CALL FUNCTION 'START_FORM'

EXPORTING

  • ARCHIVE_INDEX =

FORM = 'ZPMSCRIPT2'

LANGUAGE = PRINT_LANGUAGE

PROGRAM = SY-cprog

.

loop at it_internal into wa_internal.

CALL FUNCTION 'WRITE_FORM'

EXPORTING

ELEMENT = 'INTERNAL_WORK'

WINDOW = 'MAIN'.

ENDLOOP.

loop at it_external into wa_external.

CALL FUNCTION 'WRITE_FORM'

EXPORTING

ELEMENT = 'EXTERNAL_WORK'

WINDOW = 'MAIN'.

endloop.

If i am commenting the call of second script and printing the internal table data in first script, the data is getting printed correctly with mutiple records. This means that the way i am calling the script is correct. But when i open a new script and pass the interrnal table data, the data is not moving to second script.

former_member182465
Active Participant
0 Kudos

The problem is not yet solved. So i created 2 smartforms one in Potrait and other in Landscape.

former_member182465
Active Participant
0 Kudos

Yes, I had declared the work area globally. But even then the data is not moving to script.

Former Member
0 Kudos

Hi,

Can you please paste your peice of code, which include write_form in a loop.

May be i can help you after that. I am not able to get your like this.

Thanks,

Archana

former_member182465
Active Participant
0 Kudos

Thanks for reply Archana. I had debugged even script but new record values are not getting changed in script but getting changed in driver program.

Former Member
0 Kudos

You will have to declare the work area globablly.

Former Member
0 Kudos

Hi,

So did you try using a global variable and passing work area value to this variable?

Use this variable in script to display your value.

Please try using this approach.

And 1 more question is, you are looping at your internal table and inside loop calling 'Write_Form' right?

So, are you displaying other values from this work area inm script? if Yes, then issue with display of those values as well?

Thanks,

Archana

Former Member
0 Kudos

Hi,

Did you debug the script and check if you are getting the new work area value in your script at the time of printing?

If not then may be you can declare a variable in print program itself and after entering the loop assign in to the variable. And use this variable to display the values in the script.

Currently you must be using work area to display the value in script.

Hope it helps.

Thanks,

Archana