07-06-2007 11:30 PM
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.
07-07-2007 12:03 AM
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.
07-06-2007 11:43 PM
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.
07-06-2007 11:51 PM
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.
07-07-2007 12:03 AM
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.
07-09-2007 5:15 AM
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.
07-09-2007 3:18 PM
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.
07-09-2007 4:26 PM
it is for check mark for partcular ,based on check mark,it will validate the other fields.
Thanks
Seshu