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

Regarding printing problem in script

Former Member
0 Likes
358

Hi ABAPers,

i have a problem while printing the invoice. the problem was it was printing all the address details in All languages, expect in English.

Know i want to debug the script, i know the error will be in address window. but while debugging it was showing dump. but if i run directly it was showing the output. I dont know why it was showing the dump. i am sending the dump analysis, so can any one tell me where the problem is.

Error analysis

An exception occurred that is explained in detail below.

The exception, which is assigned to class 'CX_SY_OPEN_SQL_DB', was not caught

in procedure "ITEM_PRINT" "(FORM)", nor was it propagated by a RAISING clause.

Since the caller of the procedure could not have anticipated that the

exception would occur, the current program is terminated.

The reason for the exception is:

One of the database selections included a database Commit.

The selection was then supposed to continue. Before a

database commit, however, all outstanding database selections

must be concluded.

Possible causes in the application program:

While a read process from a database cursor is taking place

(within a loop SELECT/LOOP/EXEC SQL or before a FETCH command),

one of the following statements is used:

- MESSAGE (apart from MESSAGE S...)

- - COMMIT WORK

- - ROLLBACK WORK

- - BREAK-POINT

- - WAIT

- - CALL FUNCTION ... DESTINATION (synchronous RFC)

- - CALL FUNCTION ... STARTING NEW TASK

- - RECEIVE RESULTS

- - CALL DIALOG

- - CALL SELECTION-SCREEN

- - CALL TRANSACTION

- - CALL SCREEN, or any other statement that results in the display of a

- new screen

-

- Whenever a program runs in debugging mode, a "COMMIT WORK" can

- possibly be triggered during database selection. This abnormal

- termination can also occur in debugging mode even with a correct

- program.

- A "COMMIT WORK" during debugging may be due to the following reasons:

- 1. A program or screen was regenerated during debugging

- and updated in the database.

- 2. Each user needs a separate process in debugging mode, but

- the number of available processes is restricted. If this

- limit is exceeded, each debugging step then requires a

- "COMMIT WORK".

-

- The error occurs in a statement in which the table "LIPS " is accessed.

if zXCHPF ne ''. "batch managed

if first_batch = 'X'.

CALL FUNCTION 'WRITE_FORM'

EXPORTING

ELEMENT = 'BATCH_START2'.

clear first_batch.

endif.

if dkmein is initial or nast-kschl ne 'ZNIN'.

CALL FUNCTION 'WRITE_FORM'

EXPORTING

ELEMENT = 'BATCH_DATA2'.

else.

CALL FUNCTION 'WRITE_FORM'

EXPORTING

ELEMENT = 'BATCH_DATA3'.

endif.

endif.

endselect.

if sy-subrc ne 0.

select * from lips where vbeln = vbfa-vbelv and (this is the point where it was showing error)

posnr = vbfa-posnv.

clear vbdpl.

move-corresponding lips to vbdpl.

if not dkmein is initial.

CALL FUNCTION 'Z_GROSS_WEIGHT2'

EXPORTING

VBELN = lips-vbeln

posnr = lips-posnr

GEWEI = dkmein

IMPORTING

BRGEW = dbrgew

TABLES

XLIPS = zlps.

Thanks & Regards,

Ramana Prasad.

1 REPLY 1
Read only

Jelena_Perfiljeva
Active Contributor
0 Likes
317

I'm assuming there is ENDSELECT statement somewhere further in the program, otherwise you would have gotten a syntax error.

It seems that function 'Z_GROSS_WEIGHT2' contains COMMIT WORK. Therefore, it cannot be called inside SELECT FROM LIPS ... ENDSELECT loop. You need to change SELECT ... ENDSELECT to SELECT INTO TABLE and then call the FM inside LOOP AT <table> ... ENDLOOP.

Actually in the future try to stay away from SELECT ... ENDSELECT altogether. Most of the time they are bad for performance.

Hope this helps.