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: 

How to get value of a field of inner program into outer program(include)

Former Member
0 Kudos

I am using VOFM txn. In that i have to modify the code for 993 routine.i want to get value of tax(xvbrk-mwsbk) which is actually getting propagated inside some other include.how to get its value.plzzzzz recommend solution ASAP.

6 REPLIES 6

Former Member
0 Kudos

Hi...,

Nothing to do in your case....

That field contains the same value even out side the include also... (provided that variable should not be declared inside the include )...

regards,

sai ramesh

0 Kudos

Hi Sai,

Thnx a lot for ur reply.

But u r correct. actually that field is declared inside the include.

can u plz reply, how can we access that field outside the include.

Former Member
0 Kudos

Neha,

Try using either import/export or get/set parameter to fetch the the tax value from the include and then u can use that value in this include.

Hope this helps!!!

PS:Reward points if useful!!

Regards,

Krithiga

0 Kudos

Hi,

Thnx a lot for replying.how we can use import/export or get/set parameter to fetch field's value?

can u plz send me some example program so that i can refer it.

0 Kudos

HI,

Check the below code for GET/SET.

DATA: carrier TYPE spfli-carrid,

connection TYPE spfli-connid.

START-OF-SELECTION.

SELECT carrid connid

FROM spfli

INTO (carrier, connection).

WRITE: / carrier HOTSPOT, connection HOTSPOT.

HIDE: carrier, connection.

ENDSELECT.

AT LINE-SELECTION.

SET PARAMETER ID: 'CAR' FIELD carrier,

'CON' FIELD connection.

CALL TRANSACTION 'DEMO_TRANSACTION'.

Example for EXPORT IMPORT

<b>REPORT demo_data_ext_cluster_import.</b>

DATA text1(10) TYPE c VALUE 'Exporting'.

DATA: itab TYPE TABLE OF sbook,

wa_itab LIKE LINE OF itab.

DO 5 TIMES.

wa_itab-bookid = 100 + sy-index.

APPEND wa_itab TO itab.

ENDDO.

EXPORT text1

text2 = 'Literal'

TO MEMORY ID 'text'.

EXPORT itab

TO MEMORY ID 'table'.

SUBMIT demo_data_ext_cluster_import2 AND RETURN.

SUBMIT demo_data_ext_cluster_import3.

<b>REPORT demo_data_ext_cluster_import2 .</b>

DATA: text1(10) TYPE c,

text3 LIKE text1 VALUE 'Initial'.

IMPORT text3 FROM MEMORY ID 'text'.

WRITE: / sy-subrc, text3.

IMPORT text2 TO text1 FROM MEMORY ID 'text'.

WRITE: / sy-subrc, text1.

<b>REPORT demo_data_ext_cluster_import3 .</b>

DATA: jtab TYPE TABLE OF sbook,

wa_jtab LIKE LINE OF jtab.

IMPORT itab TO jtab FROM MEMORY ID 'table'.

LOOP AT jtab INTO wa_jtab.

WRITE / wa_jtab-bookid.

ENDLOOP.

Regards,

Sesh

.

0 Kudos

Hi,

I had a requirement like i need to do some validatins in the routine 630. So, in the program where there is a function module 'PRICING', which inturn calls this 630, i wrote a export statment like:

ws_xxxx = 'value to be exported'.

export ws_xxxx to memory id 'WS_XXXX'.

And, in the routine 630, import the data like dis:

import ws_yyyy from memory id 'WS_XXXX'.

Once, you do this free the memory id using:

Free memory id 'WS_XXXX'. Now ws_yyyy will have the value which is exported from the main program.

This will be useful only if the 630 routine is called in the same program flow. Now, assume there are two programs A and B. If you want to use the values generated in A in the B(which is no where related to B, and its is used in different place),then you need to go for SET/GET parameters(which uses the SAP memory to use the data, while ur import/export uses the ABAP memory to get and use the data).

Syntax for SET/GET:

SET PARAMETER ID 'XX' FIELD ws_xx.(give this in the program A).

GET PARAMETER ID 'XX' FIELD ws_xx.(give this in the program B, to fetch the values which was set in program A).

Hope this helps!!!

Regards,

Krithiga.