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: 

WRITE statement not working in abap editor

suityan98
Explorer
0 Kudos

I am creating a new program using se80, based on the table zcatdriverinfo, I want to let the user to insert the company code and press 'execute' to show the data from the custom table zcatdriverinfo.

However I done some code but nothing happen when I press the execute button, I used the debug mode and I see that the flow is correct and the system able to read the loop statement but nothing shown, Hopefully get some advise.

PROCESS BEFORE OUTPUT.
MODULE STATUS_0200.
*
PROCESS AFTER INPUT.
MODULE USER_COMMAND_0200.

MODULE STATUS_0200 OUTPUT.
SET PF-STATUS 'SD_DISPLAYMENU'.
SET TITLEBAR 'SD_DRIVERDISPLAY'.

ENDMODULE.

MODULE USER_COMMAND_0200 INPUT.

CASE ok_code.
WHEN 'EXECUTE'.

IF gv_bukrs IS INITIAL.
MESSAGE 'Please fill in Company code.' type 'E'.
ELSE.
perform check_data3.

perform query_data.
ENDIF.
WHEN 'EXIT'.
LEAVE TO SCREEN 0.
ENDCASE.

ENDMODULE.

"skip perform check_data3 due to long logic, debug for this part okay no problem

"Problem appear here, debug get the data however there is nothing shown

FORM QUERY_DATA.

LOOP AT lv_driver into wa_driver2.

WRITE:/15 wa_driver2-icno, ...,... .

ENDLOOP.

ENDFORM.

1 ACCEPTED SOLUTION

abo
Active Contributor

It is working as expected: in a module pool, you do no see the effect of WRITE statements until the last dynpro has been processed.

If you wish to inform the user, either use a popup (including error messages) or include a text output field in the dynpro and write your message there.

4 REPLIES 4

abo
Active Contributor

It is working as expected: in a module pool, you do no see the effect of WRITE statements until the last dynpro has been processed.

If you wish to inform the user, either use a popup (including error messages) or include a text output field in the dynpro and write your message there.

Sandra_Rossi
Active Contributor

I don't remember exactly. In "module pool programs", don't we need to use explicitly LEAVE TO LIST-PROCESSING in PBO/PAI of one screen? Isn't it only in "executable programs" that the list processing mode is automatically activated?

abo
Active Contributor
sandra.rossi

indeed we do, the one case I had in mind was that of a normal report calling a single dynpro for some task and then processing would resume: here there is no need for a LEAVE statement. Kind of contrived example, yeah.

horst_keller
Product and Topic Expert
Product and Topic Expert

In fact it is one of the greatest misunderstandings in ABAP that WRITE creates something like a console output.

WRITE writes to a list buffer and it is the task of classical list processing to output this.

The only place where this happens automatically is in classical reporting with executable programs.

For complete Information see

https://help.sap.com/doc/abapdocu_latest_index_htm/latest/en-US/index.htm?file=abenabap_dynpro_list....