cancel
Showing results for 
Search instead for 
Did you mean: 

passing internal table data from subroutine pool to internal table

naresh_bammidi
Contributor
0 Kudos

Hi experts,

i am working on sap standard scripts.here i need to populate additional fields into form layout.so for that i am writing code in external subroutine pool and calling that subroutine from my script as below.

PERFORM GET_DATA IN PROGRAM xxxxxx
                                     USING &INPUTS&
                                     CHANGING &OUTPUTS&
                                     ENDPERFORM

Here what my requirement is ,i need to pass internal table data from subroutine pool to script.By using 'Changing' parameter i can only pass one variable at a time.i tried writing write_form in subroutine pool .even though no use.please help me out.

Thanks and regards

Naresh bammidi

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Please check this thread:

Kr,

Manu.

naresh_bammidi
Contributor
0 Kudos

@manu

That thread was not answered.if i follow that method i can only display one record.please give any suggestion.

thanks and regards

naresh bammidi

former_member193831
Active Participant
0 Kudos

Hi Naresh,

In SAPScripts, you cannot pass back Internal tables from subroutine pool. You need to know exactly how many fields you want to pass.

ITCSY structure is used, and there cannot be internal table.

For LOOP based processign on tables, changes should be done in Print program itself directly. Check if you can do that, else check if you can create custom print program.

Regards,

Vivek

naresh_bammidi
Contributor
0 Kudos

hi vivek,

thanks for ur reply.as you said before,i copied standard form and standard driver program and changes made in my 'z' program.when i execute my script in debugging mode still it's executing standard one only,.not my 'z' driver program.i assigned my standard program to script like this.

pagewindows>textelements of one of the windows -


>text->check---> here i appended my 'z' driver program to 'z' script.

Is this right way ?.please help me out.<removed by moderator>

Thanks and regards

Naresh bammdi.

Edited by: Thomas Zloch on Oct 27, 2011 9:19 AM

naresh_bammidi
Contributor
0 Kudos

Hi Naresh,

>

> In SAPScripts, you cannot pass back Internal tables from subroutine pool. You need to know exactly how many fields you want to pass.

>

> ITCSY structure is used, and there cannot be internal table.

>

> For LOOP based processign on tables, changes should be done in Print program itself directly. Check if you can do that, else check if you can create custom print program.

>

> Regards,

> Vivek

You are right Vivek,

we can't pass internal table to form.alternative solution is using standard text <link to blocked site removed by moderator> or copying and changing the driver program according to our requirement.i changed the cheque printing driver program accordig to my requirement.problem resolved

Thanks alot vivek

Edited by: Thomas Zloch on Oct 28, 2011 10:47 AM

Former Member
0 Kudos

Hello.  Narlesh.

I think I meet the same problem with you on check printing.

I want to pass internal table  from subroutine to sapscript,  do you have any idea?

or it's impossible to pass internal table to sapscript?

Hope can hear from you soon.

thanks.

naresh_bammidi
Contributor
0 Kudos

Hello Harry,

It is not possible to pass the internal table from subroutine pool to sap script.I have changed the driver program according to my requirement.Assigned the new driver program in FBZP tcode.

Thanks

Naresh Bammidi

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

Try Below command it may help you.

PERFORM get_data IN PROGRAM xxxxxx

USING &input&

CHANGING &outputs&

TABLES &tables&.

naresh_bammidi
Contributor
0 Kudos

hi Vijay ,

As far as i know ,there is no such parameter 'tables' in perform command in script.i tried that one.but showing error message.

Thanks and regards

Naresh Bammidi

Former Member
0 Kudos

Hi

It's not possible to transfer an internal table from sapscript to program, but also it's not possible to transfer in internal table from program to sapscript, I mean the sapscript can see the headerline of the internal table.

Now while running sapscript your main program should be still loeaded in memory, so you can try to get that internal table by field-symbols:

FIELD-SYMBOLS: <ITAB> TYPE TABLE.

DATA: TABNAME(30) TYPE C VALUE '(<program name>)<table name'.

ASSIGN (TABNAME) TO <ITAB>.

Max

Former Member
0 Kudos

you know that you can use MORE THAN ONE using and changing parameters?

E.G. think of a sales order print where you need to print 5 additional fields on item level which you have to get via an external perform and the info to get is based on matnr and werks.

it should look like:


perform get_additional_data in program ZTEST
  using &VBDPA-MATNR&
  using &VBDPA-WERKS&
  changing &Field1&
  changing &Field2&
  changing &Field3&
  changing &Field4&
  changing &Field5&

naresh_bammidi
Contributor
0 Kudos

Thanks for your reply,

If i do like that ,it displays only one record of internal table in my form lay out.but i have to display internal table data.which may contains more than one record.how can i do that?

Thanks and regards

naresh bammidi