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 set one field and 2 different logic for output

former_member381412
Participant
0 Kudos

Hello All,

How to set one field and 2 different logic for output. Below code there is First line item logic and another is Second line item logic. Please correct or give me idea how to set logic

LOOP AT T_EKPO INTO W_EKPO.

if W_EKPO-ZMGV3 > 0.

W_EKPO-ZMGV5 = ( ( WA_FINAL-LABST / W_EKPO-ZMGV3 ) ). " First Line Item logic ( Output Logic)

""""" Second Line time logic how to set

W_EKPO-ZMGV5 = ( W_EKPO-ZBUDAT - W_EKPO-SLFDT1 ) . " Second Line item logic

W_EKPO-ZMGV5 = W_EKPO-ZMGV5 * W_EKPO-ZMGV3 + W_EKPO-MENGE.

W_EKPO-ZMGV5 = W_EKPO-ZMGV5 div W_EKPO-ZMGV3 ..

endif.

MODIFY T_EKPO FROM W_EKPO.

ENDLOOP.

Thanku so muchRegardsRicha

3 REPLIES 3

Sandra_Rossi
Active Contributor
0 Kudos

Please edit your question: select your ABAP code and click the button CODE so that it's nicely displayed and we can read it easily

FredericGirod
Active Contributor
0 Kudos

I don't understand the issu

vijay_hariharan
Contributor
0 Kudos

Hello Richa,

Not sure if this is what you are looking for but when you say 2nd Line.. do you mean the second time Loop is run.. you need to use the system field SY-TABIX which would be set to 2 BUT if the issue is something different, you'll
need to elaborate a bit as the Experts above mention..

LOOP...
.. " for Second line
IF SY-TABIX = 2
" OR from Second line
IF SY-TABIX >= 2
........
ENDLOOP.

Regards,
Vijay