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

How does a program knows whether it runs asynchronous?

former_member757708
Discoverer
0 Likes
510

We have a tool which runs fine at several systems, but fails for one customer.

It displays a list of analysed data and offers the option to update some material master data to adapt mrp data of material master to the real situation of selected material. The update is done with an asynchronous call of function material_maintain_dark, results (success or error messages) are written to sytem log.

In one system this logic fails, because customer has an implementation in one of the user exits of function material_maintain_darc which calls a popup.

IF sy-batch IS INITIAL AND sy-binpt IS INITIAL.

CLEAR: l_text_table[], l_text_table.

MESSAGE w001(z_sdc) INTO l_text_table-tdline.

APPEND l_text_table.

CALL FUNCTION 'COPO_POPUP_TO_DISPLAY_TEXTLIST'

EXPORTING

titel = 'Warning'

TABLES

text_table = l_text_table.

ENDIF.

Popup correctly will not be displayed when programm runs in batch mode.I think we need a similar check to avoid the popup when the program runs asynchronously, but I could not find any matching indicator in structure syst (I could not find documentation for really all fields) or anywhere else.

Can anyone help and tell me how I can check at runtime whether a program runs asynchronously.

2 REPLIES 2
Read only

Former Member
0 Likes
467

why a popup in dark, which implies that it runs "in the dark", e.g., without user interaction!? Should it not have just a message to the log....If you're running this in background, I would expect an abend since the program cannot get to the screen...is that what you're seeing? As far as async is concerned, we could say that, unless specified by dependencies in scheduling, etc., ALL programs execute asynch.

Read only

0 Likes
467

It was not my decision to use this popup. Customer has it as own coding in an unserexit of function material_maintain_dark probably created during implementatiion project by customer himself or any consultants.

We delivered a 'consulting solution', a program which uses function material_maintain_dark and works fine on several other customers systems, where no user exit is implemented.

Customer regards it as an error of our customer solution, that the booking of changes of material master, which is triggered by our program does not work in his system: There only is a message, that program is triggered, but it cannot be completed properly and they see neither results in material master nor entries in system log.

My idea was to add a check, whether the function material_maintain_dark was triggered by our customer solution via call function.. starting new task or whether it is used by any of the customers own processes, but I have no idea how to find out, whether function was called with or without 'starting new task'.