Application Development and Automation 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: 
Read only

Calling routine from SO10

Former Member
0 Likes
2,295

Hi All,

While calling a routine from SO10, both input table and output table are empty, I have used in following way..

/: DEFINE &PER& = &PTXT1-PERNR&

/: PERFORM ADDRESS IN PROGRAM ZHR_OFFER

/: USING PER

/: CHANGING &P0001-PERNR&

/: CHANGING &STRAS&

/: ENDPERFORM

In routine (ABAP)

FORM ADDRESS tables in_tab structure itcsy out_tab structure itcsy.

Data: v_name2 like p0006-name2, " C/O

v_stras like p0006-stras. " Street/House no

read table in_tab index 1.

if sy-subrc = 0.

...

...

EndForm.

Here both in_tab and out_tab are empty while debugging i found that (in std program, which is calling routine)

perform (co_perform-form) in program (co_perform-program)

tables co_sym_using

co_set_symbols

Here co_perform-form is filled with ADDRESS and

co_perform-program is filled with ZHR_OFFER, but

co_sym_using, co_set_symbols tables are empty.

Since these tables are empty, values are not getting passed from SO10 to ABAP, Your input on this please.

Thanks,

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,782

Is the program ZHR_OFFER a report program or a subroutine pool..

If it is a subroutine pool try creating a report and add your subroutine..And then try printing the form..

As in the sap help examples..He has given report program as the abap program..

http://help.sap.com/saphelp_40b/helpdata/en/d1/803279454211d189710000e8322d00/content.htm

Thanks,

Naren

Is the program ZHR_OFFER a report program or a subroutine pool..

If it is a subroutine pool try creating a report and add your subroutine..And then try printing the form..

As in the sap help examples..He has given report program as the abap program..

http://help.sap.com/saphelp_40b/helpdata/en/d1/803279454211d189710000e8322d00/content.htm

Thanks,

Naren

10 REPLIES 10
Read only

Former Member
0 Likes
1,782

Hi,

Try passing &PER& instead of PER..

: DEFINE &PER& = &PTXT1-PERNR&

/: PERFORM ADDRESS IN PROGRAM ZHR_OFFER

/: USING <b>&PER&</b>

/: CHANGING &P0001-PERNR&

/: CHANGING &STRAS&

/: ENDPERFORM

Thanks,

Naren

Read only

0 Likes
1,782

Hi Naren,

I tried by giving <b>&PER&</b> as well, even this is also not working out, is there is anywhere i am going wrong ?, your suggestions on the same please.

Thanks,

Read only

Former Member
0 Likes
1,782

Hi,

Write the perform in a sapscript form instead of in the standard text..Check this..I am not sure if this could be a problem..

Thanks,

Naren

Read only

0 Likes
1,782

Hi Naren,

Actually my requirement is to make it from standard text, because in HR some <b>features</b> are being used, these feature is referring to the standard text only. Can my requirement be accomplished through standard text.

Thanks,

Read only

Former Member
0 Likes
1,783

Is the program ZHR_OFFER a report program or a subroutine pool..

If it is a subroutine pool try creating a report and add your subroutine..And then try printing the form..

As in the sap help examples..He has given report program as the abap program..

http://help.sap.com/saphelp_40b/helpdata/en/d1/803279454211d189710000e8322d00/content.htm

Thanks,

Naren

Read only

0 Likes
1,782

Hi,

Naren: I am using Report program only, its not subrouting pool

Dharitree: In standard text &PTXT1-PERNR& is getting populated, as per my understanding I dont think this will be the problem, because at runtime the structure PTXT1 is getting populated.

Whether my requirement is possible in standard text ?

Thanks for your time..

Read only

0 Likes
1,782

Hi Gar,

Amit is right.

Write:

PERFORM ADDRESS IN PROGRAM ZHR_OFFER

/: USING &PTXT1-PERNR&

/: CHANGING &P0001-PERNR&

/: CHANGING &STRAS&

/: ENDPERFORM

Don't define any variable in Text.

Regards,

Dharitree

Read only

Former Member
0 Likes
1,782

Hi Gam,

According to me, it won't work in Standard text because your variable "PTXT1-PERNR" is in script. So you will not get value in Satndard text that's why you input_tab is empty.

You will have to write a code in script only.

Regards,

Dharitree

Read only

Former Member
0 Likes
1,782

Hi gar,

1. why are u using another variable &PER&

2. &P0001-PERNR is already available.

3. Don't pass any variable which is defined

in so10 using DEFINE.

4. Only use variables defined in the driver program.

5.

PERFORM ADDRESS IN PROGRAM ZHR_OFFER

/: USING &P0001-PERNR&

/: CHANGING &P0001-PERNR&

/: CHANGING &STRAS&

/: ENDPERFORM

regards,

amit m.

Read only

Former Member
0 Likes
1,782

Hi,

Try this out ....

In Routine:-

<b>/: PERFORM ADDRESS IN PROGRAM ZHR_OFFER
/: USING &PTXT1-PERNR&
/: CHANGING &P0001-PERNR&
/: CHANGING &STRAS&
/: ENDPERFORM</b>

In ABAP Program:-

FORM ADDRESS tables in_tab structure itcsy out_tab structure itcsy.

Data: v_name2 like p0006-name2, " C/O
v_stras like p0006-stras. " Street/House no

read table in_tab index 1.
if sy-subrc = 0.
 pass the values to the fields
Endif.
read table out_tab index 1.
 out-tab-value = 'pass the value'.
<b>MODIFY OUT_PAR INDEX SY-TABIX.</b>
EndForm.

Regards

Sudheer