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

Modify Statement-Whether updated or created new entry

Former Member
0 Likes
560

Hello Experts,

I would like to know whether a MODIFY statement has updated the entry or it created a new entry based in one line or by any one variable.

Kindly suggest me the shortest way of finding it.

counting the number of entries is big process as i need to repeat this for 15 times in my program.

Thank you,

Viswanath A.

2 REPLIES 2
Read only

Former Member
0 Likes
525

Hi

Set a flag variable where you use MODIFY statement. Have a IF statement for that flag, if the status is 'x' then insert the data and have a write statemnt to display or set a status information that created a new entry. Similarly if the flag value is ' ' then it means it is going to update the data. Just have your code like this..

WHEN action.

IF AFLAG = 'X'.

INSERT ZVX_TCURT INTO TABLE TCURT_TAB.

NO_ROWS = NO_ROWS + 1.

// HAVE YOUR WRITE TSTAEMENT HERE OR STATUS INFORMATION FOR INSERTION

AFLAG = ' '.

ELSE.

MODIFY TCURT_TAB INDEX ROW_NO FROM ZVX_TCURT.

ENDIF.

MODIFY YCL_TCURT.

// HAVE YOUR WRITE TSTAEMENT HERE OR STATUS INFORMATION FOR UPDATION

Regards

Vinodh

Read only

Former Member
0 Likes
525

Thanks