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

retaining screen fields after BDC

Former Member
0 Likes
990

Hello friends,

I am writing a BDC program and Using call transaction method, Mode 'A' update 'S'.

I am assuming after the program is executed it calls the transaction. once i hit save on the transaction it would come back to the selection screen of the program that i executed and wil have the entries in the selection screen.

If not what would happen.

My requirement is i fill the entries in the selection screen and call the transaction. adn then at the transaction screen i hit save. once i hit save i want the selection screen to be displayed and the values in the fields. However for some plants the fields should be earsed.

Any suggestions,

Shejal

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
957

ANy suggestions,

Shejal.

7 REPLIES 7
Read only

Former Member
0 Likes
958

ANy suggestions,

Shejal.

Read only

0 Likes
957

So you want to fill the fields on your selection screen with data that was entered during the call transaction? This is correct? If so, unfortunatly, you can only bring back from the call transaction what is being passed back through the MESSTAB in the extension MESSAGES INTO MESSTAB. Usually it is only the object number like if creating a sales document, the SD number would come back via a message parameter. There is one work around. Lets say for example, you are call transaction VA01 and creating a sales document. What you can do immediatly after the CALL TRANSACTION, is read the database to get the data that you just entered, for example, do a SELECT against VBAK and get the values that have been written to the DB by VA01. The only problem with this is there may(and usually will) be a delay, where the system is still updating in another task, so when you do the SELECT the data is not there yet. In that case, if it is not too long, you can put a delay after the CALL TRANSACTION to wait a couple seconds for the update to take. You can also try setting the update mode in the call transaction statement to "L" for local update. This may also help.

Regards,

Rich Heilman

Read only

0 Likes
957

Then once you get the values, you can simply fill the parameters of your selection screen with the values that you retrieved from the database.

Regards,

Rich Heilman

Read only

0 Likes
957

Thanks Rich,

I will work on it,

Anyways If i am executing a ABAP program with selection screen and after the report runs, it downloads the text file. However the fields in the selection screen has values. how can i make them blank in the program.

i tries using the clear statement.

clear : p_vkorg,

p_spart.

Shejal.

Read only

0 Likes
957

If you want the field in the selection screen to be cleared, you can simply use the following statement after the download logic.


FREE MEMORY.

Regards,

Rich Heilman

Read only

0 Likes
957

Thanks Rich,

Free memory makes all the fields blank. However if I want to make certain field blank and retain values in certail field.

Shejal.

Read only

0 Likes
957

Yes, that's right, FREE MEMORY will clear them all. If you want to just clear certain ones, you will have to handle special. Take this example, here we are using some gernic parameter ids to handle it.



report zrich_0001.



parameters: p_fld1 type c memory id p1,
            p_fld2 type c memory id p2,
            p_fld3 type c memory id p3.

at selection-screen output.

GEt PARAMETER ID 'P1' field p_fld1.
GEt PARAMETER ID 'P2' field p_fld2.
GEt PARAMETER ID 'P3' field p_fld3.

start-of-selection.

  write:/ p_fld1, p_fld2, p_fld3.


SEt PARAMETER ID 'P2' field space.

Regards,

RIch Heilman