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: 

Doubt in Table Control

madhu_reddy22
Participant
0 Kudos

HI Gurus,

can some one tell me why we are using the module

module RACUNI_mark input.

and the field WA_OUTPUT-CHECK. in the code below. Thanks a lot.

PROCESS AFTER INPUT.

*&spwizard: pai flow logic for tablecontrol 'RACUNI'

loop at IT_OUTPUT.

chain.

field WA_OUTPUT-BROJPL.

field WA_OUTPUT-BROJST.

field WA_OUTPUT-BELNR.

field WA_OUTPUT-REFERENCA.

field WA_OUTPUT-IZNOS.

field WA_OUTPUT-SIROVINA.

field WA_OUTPUT-JM.

field WA_OUTPUT-CENA.

field WA_OUTPUT-UGKOL.

module RACUNI_modify on chain-request.

field WA_OUTPUT-CHECK

module RACUNI_mark on request.

endchain.

endloop.

module RACUNI_user_command.

this is module.

module RACUNI_modify input.

MODIFY IT_OUTPUT

from WA_OUTPUT

index RACUNI-current_line.

endmodule.

module RACUNI_mark input.

data: g_RACUNI_wa2 like line of IT_OUTPUT.

if RACUNI-line_sel_mode = 1

and WA_OUTPUT-CHECK = 'X'.

loop at IT_OUTPUT into g_RACUNI_wa2

where CHECK = 'X'.

g_RACUNI_wa2-CHECK = ''.

modify IT_OUTPUT

from g_RACUNI_wa2

transporting CHECK.

endloop.

endif.

modify IT_OUTPUT

from WA_OUTPUT

index RACUNI-current_line

transporting CHECK.

endmodule.

*&spwizard: input module for tc 'RACUNI'. do not change this line!

*&spwizard: process user command

module RACUNI_user_command input.

OK_CODE = sy-ucomm.

perform user_ok_tc using 'RACUNI'

'IT_OUTPUT'

'CHECK'

changing OK_CODE.

sy-ucomm = OK_CODE.

endmodule.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Just remember when you see chain endchain or field statement ,then it is validation for fields.

PROCESS AFTER INPUT.

*&spwizard: pai flow logic for tablecontrol 'RACUNI'

loop at IT_OUTPUT.

chain.

field WA_OUTPUT-BROJPL.

field WA_OUTPUT-BROJST.

field WA_OUTPUT-BELNR.

field WA_OUTPUT-REFERENCA.

field WA_OUTPUT-IZNOS.

field WA_OUTPUT-SIROVINA.

field WA_OUTPUT-JM.

field WA_OUTPUT-CENA.

field WA_OUTPUT-UGKOL.

module RACUNI_modify on chain-request.

field WA_OUTPUT-CHECK

<b>module RACUNI_mark on request.</b> -> you can write the validation on module

endchain.

endloop.

look at doumentation for better understanding what does Chain end endchain ,field statement.

Thanks

Seshu

module RACUNI_user_command.

6 REPLIES 6

Former Member
0 Kudos

Hi Madhu,

The table control appears to have a column that is markable (you can highlight the row). The purpose of the racuni_mark input module is to transport the mark field (type char which can be either blank or 'X') for the row from the screen to the ABAP program so it can identify which records are selected. The code changing the internal table behind the screen by copying the check (mark) field is below.

modify IT_OUTPUT
from g_RACUNI_wa2
transporting CHECK.

Former Member
0 Kudos

Hi madhu,

It is very simple, It is a table control code, using wizard.

it_output is your internal table which populates the fields in the table contol in the screen. wa_output fields are used in for validation purpose. If anyone of the field is entered with wrong value it is going to validate and enables all the fields for input again.

RACUNI_mark input - is the module(kind of subroutine in normal abap) used for validating your internal table entries.

say for example:

RACUNI-line_sel_mode = 1 and WA_OUTPUT-CHECK = 'X'. is the condition.

whenever the condition is fulfillled you are pulling the records from it_output and modifying the check field from 'X' to Blank in the internal table it_output.

That's all.

Former Member
0 Kudos

Just remember when you see chain endchain or field statement ,then it is validation for fields.

PROCESS AFTER INPUT.

*&spwizard: pai flow logic for tablecontrol 'RACUNI'

loop at IT_OUTPUT.

chain.

field WA_OUTPUT-BROJPL.

field WA_OUTPUT-BROJST.

field WA_OUTPUT-BELNR.

field WA_OUTPUT-REFERENCA.

field WA_OUTPUT-IZNOS.

field WA_OUTPUT-SIROVINA.

field WA_OUTPUT-JM.

field WA_OUTPUT-CENA.

field WA_OUTPUT-UGKOL.

module RACUNI_modify on chain-request.

field WA_OUTPUT-CHECK

<b>module RACUNI_mark on request.</b> -> you can write the validation on module

endchain.

endloop.

look at doumentation for better understanding what does Chain end endchain ,field statement.

Thanks

Seshu

module RACUNI_user_command.

0 Kudos

HI Guyz,

So is there a column called CHECK in the table(which actually appears in the screen) or is it just used for validation.

0 Kudos

Hi Madhu,

There is actually a column called check in the internal table that is represented in the table control. The purpose of this column is to allow the program to identify which rows are 'marked' by the user - not validation.

0 Kudos

it is for check mark for partcular ,based on check mark,it will validate the other fields.

Thanks

Seshu