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: 

data selected only in debug mode

k_gjergja
Participant
0 Kudos

Hello ,

Aftere execution function 'MIGO_DIALOG' i need to select data from MKPF table usin values in parameters

MBN and MJA as key fields ( mkpf-mblnr for mkpf-mblnr).

Problem is that selection gives results ONLY in debuge mode.

When I run the program (without break points) data is NOT selected

Please advice

-code

GET PARAMETER ID 'MBN' FIELD gv_mblnr.

GET PARAMETER ID 'MJA' FIELD gv_mjahr.

SELECT SINGLE * FROM mkpf INTO ls_mkpf

WHERE mblnr = gv_mblnr

AND mjahr = gv_mjahr .

1 ACCEPTED SOLUTION

raymond_giuseppi
Active Contributor

(The MIGO dialog is executed in another LUW and use a COMMIT AND WAIT as almost every SAP transaction)

You have to wait until the update task are run and database buffer are updated (FAQ)

5 REPLIES 5

raymond_giuseppi
Active Contributor

(The MIGO dialog is executed in another LUW and use a COMMIT AND WAIT as almost every SAP transaction)

You have to wait until the update task are run and database buffer are updated (FAQ)

0 Kudos

To avoid waiting an arbitrary number of seconds, you may tell the system to do the updates synchronously (they are asynchronous by default), by using a batch input with the parameter UPDATE 'S' or OPTIONS FROM with ctu_params-updmode = 'S'. That way, all COMMIT WORK will be considered as being COMMIT WORK AND WAIT. For example :

DATA ctu_params TYPE ctu_params.
DATA bdcdata TYPE TABLE OF bdcdata.
ctu_params-updmode = 'S'. " synchronous updates 
CALL TRANSACTION '...' USING bdcdata OPTIONS FROM ctu_params.

In your case, you may create a custom transaction code which calls MIGO_DIALOG. You do a CALL TRANSACTION as above + ctu_params-dismode = 'E' because MIGO_DIALOG displays screens, and you must use RACOMMIT because maybe the Save action does more than one COMMIT WORK:

ctu_params-dismode = 'E'. " keep screen displayed
ctu_params-racommit = 'X'. " continue after first COMMIT

Note that you pass an empty BDCDATA internal table to USING.

k_gjergja
Participant
0 Kudos

Hello ,

Thank you for answer. What I need to do is after migo is done and material document is created

I want to continue with processing in Z program. The problem is when I set function parameter

i_leave_after_post = 'X'. The flow gets out migo straigth after execution of 'MIGO_DIALOG' so it doesn't get to logic I developed .

I other case when parameter i_leave_after_post in BLANK , user needs to hit the 'BACK' button to continue fow.

I didi try with user exits after ( posting is done in migo and material document is created) ,but all of them comes in execution after creation of material document but BEFORE comit is done.

So marterial documen, that I ma suposed to use in my program is not valid .

pramod_singh4
Explorer
0 Kudos

I Agree with Raymond Giuseppi, U need to wait till tables are getting updated. When you execute in debug mode, program will have sufficient time to update tables.

Please get me more details, I have done such requirement.

k_gjergja
Participant
0 Kudos

Indeed WAIT UP 30 SECONDS solved the problem

Thank you