2013 Jan 12 12:31 PM
Hi All,
In my program i have a table control called "ATAB"with two check box "approve" and "reject" in front of every line. Later when user ticks "approve" or "reject" in check box that should be saved when i press the "SAVE BUTTON" and it should popup a error message when both the "APPROVE"check box and "REJECT"check box are ticked .
please see the pic below ...
PLEASE HELP...
MORE IMPORTANTLY I AM A BEGINNER.. PLEASE EXPLAIN ME IN DETAIL
Hi All,
In my program i have a table control called "ATAB"with two check box "approve" and "reject" in front of every line. Later when user ticks "approve" or "reject" in check box that should be saved when i press the "SAVE BUTTON" and it should popup a error message when both the "APPROVE"check box and "REJECT"check box are ticked .
please see the pic below ...
PLEASE HELP...
MORE IMPORTANTLY I AM A BEGINNER.. PLEASE EXPLAIN ME IN DETAIL
2013 Jan 12 2:47 PM
Hi mohamed,
Go through this link below.
http://www.sapdev.co.uk/dialog/tabcontrol/tc_mark.htm.
In order to get pop up use FM 'POPUP_TO_CONFIRM'.
For checkbox write like this,
if approve = 'X' or reject = 'X'.
do the operation.
Regards,
Vijay
2013 Jan 13 6:56 AM
Hi vijay kumar for your kind replay ,
My question is
can u see the pic now
2013 Jan 13 8:28 AM
Hi mohamed,
track in the sense? means what?
where you have to save?
you can apply the condition for that rite.
Regards,
vijay
2013 Jan 13 9:17 AM
Hi Naveen,
1. To track the chechbox : When the user selects any of the checkboxes , internally the field will have a 'X' value i.e ATAB-aprove or ATAB-reject will hold a X value.So, this value will help you to track the field whether it is checked or not.
2. To save the particular line : Check for both the fields with 'X' Value.
3. To give a pop-up : If both the fields have a value 'X' then, use a Function module POPUP_TO_CONFIRM to raise a pop up.
Hope this helps. Do let me know if anything else is required.
Thanks,
Namrata
2013 Jan 13 9:19 AM
In the PAI of main screen you should have written something like
* Here function defined as exit (back, cancel, etc.)
* so no check of data required
MODULE USER_COMMAND AT EXIT-COMMAND.
* Here PAI of subscreen
CALL SUBSCREEN sub_area.
* ...
* Same module, but here applicative functions only will triggger
MODULE USER_COMMAND.
In the PAI of the subscreen (tab with table control)
* Loop at table control
LOOP AT itab.
CHAIN
FIELD itab-box1.
FIELD itab-box2.
" check only one box checked
MODULE check_one_box.
ENDCHAIN.
" update internal table
MODULE modify_itab.
ENDLOOP.
Then
Alternative :
Regards,
Raymond
2013 Jan 13 10:25 AM
Now my problem is when i click the check box the tick disappears but when i run the debugger the value 'X' for the CHECK BOX field has been append to the internal table but the tick symbol disappears in the screen.
hear is my CODE:
WHEN 'APPROVE' "FUNCTION FOR THE CHECK BOX".
IF ITAB_INBOX-APPROVE EQ ' '."ITAB_INBOX IS THE INTERNAL TABLE"
ITAB_INBOX-APPROVE = 'X'.
MODIFY ITAB_INBOX INDEX sy-tabix TRANSPORTING APPROVE. "APPROVE FIELD NAME FOR THE CHECK BOX"
ELSEIF ITAB_INBOX-APPROVE EQ 'X'.
APPROVE = ' '.
MODIFY ITAB_INBOX INDEX sy-tabix TRANSPORTING APPROVE.
ENDIF.
please help .
2013 Jan 13 10:43 AM
Remove most of your code, when clicking on the box the value is changed in dynpro field switching between space and 'X', so if you check a box when previous value was initial, the click set it to 'X' and your code reset it to initial ?
Just "ignore" in PAI the function code attached to check box (consier it as Enter) and let the LOOP AT itab of the PAI do the update of internal table. Those codes should only have to trigger a PAI/PBO cycle so check of data when user click.
Regards,
Raymond
2013 Jan 13 10:54 AM
and also help me to trace the line in the table control.
THANKS IN ADVANCE
2013 Jan 13 12:36 PM
ok,but from which value should i update my internal table??
and i want to know which row of the check box is checked???
Thankyou for your reply.
2013 Jan 13 12:55 PM
Thanks Raymond Giuseppi
Do SAP have any demo program regarding to my scenario??
If any can you provide the program name??
Thank you.
2013 Jan 12 3:04 PM