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 Read the Screen Fields after a Transaction ?

Former Member
0 Kudos

Hi all,

I am working on the Transaction 'O4K_LICENSE'. After the transaction is run, it generates an Internal License number which is displayed on the screen. I tried using 'GET PARAMETER', but as the CALL TRANSACTION is called within a loop, the SAP Global memory is not getting refreshed and iam getting the same value for every loop for the Internal License Number.

Is there any function Module other than DYNP_VALUES_READ to get the screen field values? I tried using the above function module, but in vain and it is not getting any values.

Warm Regards,

Vijay.

19 REPLIES 19

Former Member
0 Kudos

Hi

I think you can't do it, because after calling transaction the program has just finished to work.

You shoul try to get out this value from messages table:

call transaction ..... MESSAGES INTO itab

Max

Former Member
0 Kudos

Hi,

Please try this.

Use the Same FM "<b>DYNP_VALUES_READ</b>" before the call transaction. Export this to database index so that even after recursive calls the value in memory doesnlt get refreshed.

DATA :w_indx_docov TYPE indx-usera.

w_indx_docov = sy-uname.

<b>EXPORT var1 TO DATABASE indx(c1) ID w_indx_docov.</b>

Similarly you can IMPORT.

Please reward points if this explanation is useful.

Regards,

Siva

Former Member
0 Kudos

Hi,

Use CALL TRANSACTION....MESSAGES IN TO T_MESSTAB.

Declare T_MESSTAB as below -

DATA T_MESSTAB LIKE BDCMSGCOLL OCCURS 0 WITH HEADER LINE.

0 Kudos

I checked in the Message table for a message which has the Internal License Number, but it doesnot show up any message. The surprising thing is that the Database table OIHL is getting updated with the Internal License Number. But Iam in a situation where i cannot fire a select query, because every record has to be associated with a record number.

0 Kudos

Hi

I don't know this transaction, because I've never worked on OIL vertical, but how does SAP create this Internal License Number? Are there some object as numeric range?

If it was so, you could try to read this object.

Max

0 Kudos

Hi Max,

I am not really sure about how SAP Creates this Unique number, but once i enter all the required data on the screen and save, the internal Licence Number field gets populated automatically. and this follows a sequence which increments by 1.

0 Kudos

Hi

You could try to active sql trace and run this transaction, perhaps you can get out some informations are usefull for you.

Max

0 Kudos

hai,

try this syntax

call transaction <tcode> ........using <bdcmsgcoll type internal table>

so after the excution of bdc the number generated will be stored in MSGV1

come back if any dubts

cheers

0 Kudos

Hi kumar,

I tried doing that but there is no value in MSGV1 of the Message table. The Case looks very complicated.

Anyways, thanks for the reply

Warm Regards,

Vijay

0 Kudos

hi,

I mean to say your case either export or dynp_values_read is not useful.

is there any possibility to get the internal number from the database by specifing some conditions?

cheers,

sasi

0 Kudos

Infact, iam trying to do the same. But it proves to be very costly when seen from the performance perspective.

I have no other option but to write a select query within the loop, and the number of records which are looped at are atleast 90000 to 2,00,000.

0 Kudos

hi,

use select single and specify key fields as much as possible, inclding username also

cheers,

sasi

0 Kudos

Well .... let me explain this very clearly.

The table OIHL has a composite primary key which is the combination of "External License Number" and "Internal License Number". The latter is generated after running the O4K_LICENSE transaction.

Moreover, iam attaching every record with a record generated in the program. Now, the same User(ERNAM) can create records having the same External License Number.

For example:

If i created a record yesterday with an external License Number 123, then say an internal lic no of 3 is assigned to it.

If i Create another record today with the same external lic no of 123, and an internal no of say 20 is attached to it, then i donot have any criterion to select the one which i have created today, as it fetches both the records.

To add to the worst, there is no timestamp field also.

Message was edited by: Vijay Sai

0 Kudos

hi,

retrieve the records by using ernam then

data : begin of itab_oil,

licnumber type xxxxx,

end of itba_oil.

select licnumber from oihl into table itab_oil

where ...............

ernam = 'xxxx'

if sy-subrc is initial.

sort itab_oil by licnumber by descending

read table itab_oil index 1.

licnumber = itab_oil-licnumber

endif.

as you previously mentioned the number are incerement one by each posting

is it helpful

cheers,

sasi

0 Kudos

Well ... infact, iam planning to do the same.

I've Just found out a field "ERTIM" i.e the time at which the Record is created. So, iam planning to read the time and "created on" just before the loop and also, after the completion of the loop. Now, i can narrow doen my selection using this time, day and the username.

I reckon, it should work

Anyways, thanks for the reply.

0 Kudos

hi,

please reward points if the answers were helpful

cheers,

sasi

0 Kudos

Hey Sasikumar,

Awarded the points

Anyways, thanks a lot for all the valuable suggestions for one and all.

Thanks and Regards,

Vijay.

Former Member
0 Kudos

hi,

the particular transaction 'O4K_LICENSE' must export the data to memory (using export option) then only you can get it in your program and the function module also used to retrieve the current screen values.

You find out after generation internal number where it it stored ( in dbtab tales) and retrieve using some creteria

cheers,

sasi

0 Kudos

Hi sasikumar,

Thanks for the reply :).

Iam new to ABAP. Can u please let me know the usage of this export command in my case.

Thanks and Regards,

Vijay