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

Table maintenance Events (01)

NAeda
Contributor
0 Likes
611

Dear Friends,

I have one ztable with 4currency fields, I have to validate the sum( ie total of the row(4 currency fields) )to 100% in the table maitanence events.

how to use TOTAL and EXTRACT.

please kindly help me how to do this.

thanks

Regards

Narsim

Dear Friends,

I have one ztable with 4currency fields, I have to validate the sum( ie total of the row(4 currency fields) )to 100% in the table maitanence events.

how to use TOTAL and EXTRACT.

please kindly help me how to do this.

thanks

Regards

Narsim

2 REPLIES 2
Read only

Former Member
0 Likes
562

FORM abc.

DATA: F_INDEX LIKE SY-TABIX. "Index to note the lines found

LOOP AT TOTAL.

IF <ACTION> = desired constant.

READ TABLE EXTRACT WITH KEY <vim_xtotal_key>.

IF SY-SUBRC EQ 0.

F_INDEX = SY-TABIX.

ELSE.

CLEAR F_INDX.

ENDIF.

(make desired changes to the line TOTAL)

MODIFY TOTAL.

CHECK F_INDX GT 0.

EXTRACT = TOTAL.

MODIFY EXTRACT INDEX F_INDX.

ENDIF.

ENDLOOP.

SY-SUBRC = 0.

ENDFORM.

MIGHT HELP YOU

Read only

Former Member
0 Likes
562

Hi Narsim.

Go to SE11 and open your Ztable

click on the Table maintenance generator.

you can find the function group. right

Take the Function group name and go to Tcode SE37 and open the Function Group.

In the Status of the small window of the Function group display

you can find out change requests , Main program and Function group Docu tabs.

Click on Main program and create user defined Include. check the sample code below

Click on main program

Create user defined include

*******************************************************************

  • User-defined Include-files (if necessary). *

*******************************************************************

  • INCLUDE LZPHIRF... " Subprograms

  • INCLUDE LZPHIRO... " PBO-Modules

  • INCLUDE LZPHIRI... " PAI-Modules

  • Create the below include.

INCLUDE LZPHIRI01. " PAI-Modules

Double click on the Include name. you have the below code

Loop at Extract.

module liste_init_workarea.

chain.

field fild1

field fild2

---

---

field fild n

module set_update_flag on chain_request.

*********************************************

You have to add a new module here

check the below code

*********************************************

*----User defind module

Module user_defind_validation.

endchain.

Double click on module write code in that.

----


  • Include <Include Name> *

----


&----


*& Module user_defind_validation

&----


Module user_defind_validation.

Here you can write your own validations.

field2 = field1 /2.

field4 = field1 /4.

if field4 <> field3.

message.

endif.

EndModule. "user_defind_validation

Try this code

Regards

Sreeni