‎2007 May 24 6:58 AM
Hi
I have a basic list whose first two fields are checkboxes.
I have to select only one checkbox from first list and can have multiple selections in second checkbox.
In a row only one checkbox can be selected.
Based on these selections i have to update a table with the other entries of my basic list.
how do i do it???
‎2007 May 24 7:25 AM
Hi
Keep the conditions that a single check box has to be selected with in a row.
Sample like code :
for getting the selected checkboxes.
CLEAR v_lisel.
DO.
READ LINE sy-index FIELD VALUE v_chk.
IF sy-subrc NE 0.
EXIT.
ENDIF.
READ LINE sy-index FIELD VALUE sy-lisel INTO v_lisel.
IF v_lisel+2(1) = ' ' AND sy-index GT 5.
v_lisel+2(1) = 'X'.
MODIFY LINE sy-index FIELD VALUE sy-lisel FROM v_lisel.
ENDIF.
ENDDO.
and picking up the documnet no of selected checkbox records
REFRESH itab.
DO.
CLEAR v_chk.
READ LINE sy-index FIELD VALUE v_chk.
IF sy-subrc NE 0.
EXIT.
ENDIF.
IF v_chk = 'X'.
lv_profi = sy-lisel+49(12).
itab-profi = lv_profi.
APPEND itab
CLEAR itab.
ENDIF.
ENDDO.
SORT itab BY profi.
DELETE ADJACENT DUPLICATES FROM itab.
<REMOVED BY MODERATOR>
Regards
Anji
Edited by: Alvaro Tejada Galindo on Feb 27, 2008 6:21 PM
‎2007 May 24 7:13 AM
Hi
Please be more clear about what the checkboxes represent and what are the other columns.
I dont find any difficulty in looping on the internal table contents for both first and second list and update.
Regards,
Raj
‎2007 May 24 7:23 AM
Hi Mayur
Can you please explain ur requirement thru screenshot for more clarity and better response.
Regards,
Sreeram
‎2007 May 24 7:25 AM
Hi
Keep the conditions that a single check box has to be selected with in a row.
Sample like code :
for getting the selected checkboxes.
CLEAR v_lisel.
DO.
READ LINE sy-index FIELD VALUE v_chk.
IF sy-subrc NE 0.
EXIT.
ENDIF.
READ LINE sy-index FIELD VALUE sy-lisel INTO v_lisel.
IF v_lisel+2(1) = ' ' AND sy-index GT 5.
v_lisel+2(1) = 'X'.
MODIFY LINE sy-index FIELD VALUE sy-lisel FROM v_lisel.
ENDIF.
ENDDO.
and picking up the documnet no of selected checkbox records
REFRESH itab.
DO.
CLEAR v_chk.
READ LINE sy-index FIELD VALUE v_chk.
IF sy-subrc NE 0.
EXIT.
ENDIF.
IF v_chk = 'X'.
lv_profi = sy-lisel+49(12).
itab-profi = lv_profi.
APPEND itab
CLEAR itab.
ENDIF.
ENDDO.
SORT itab BY profi.
DELETE ADJACENT DUPLICATES FROM itab.
<REMOVED BY MODERATOR>
Regards
Anji
Edited by: Alvaro Tejada Galindo on Feb 27, 2008 6:21 PM
‎2008 Feb 27 11:07 PM
Hi1
In the transaction cj20n I had been asked to create a checkbox for multi well option which I have created. At the project level as well as the WBS level they want this checkbox which I have created. Now it is required that when chech box is checked, it should validate the remote sump field and populate it with valid location based on the DLS or NTS selection as radiobutton.
If the checkbox is unchecked, it shld validate the surface location field and populate it,If DLS or NTS selected , it validates the surface loaction with valid surface location based on DLS or NTS selection.
The coding for the screens are as follows , but I am not sure if it is correct as it dosent give the desired result.Kindly help me out a sits an urgent work given and help will be hihgly appreciated and rewarded.
As per the current functionality , if DLS or NTS selected and well ID populated, validate that the well ID adheres to the appropriate formatting.
This is for screen 600 similary I have done for screen 700 but I am not able to validate still or get teh result. zzmulti_well is the field for new checkbox option created (multi well).
MODULE check_0600_zsurflocn INPUT.
IF proj-zzmulti_well IS INITIAL.
IF proj-zzsurflocn IS NOT INITIAL.
CASE 'X'.
WHEN proj-zzdls.
lv_result = zcl_well=>check_dls_sr( location_id = proj-zzsurflocn ).
IF lv_result IS INITIAL.
MESSAGE e003(zwell). " Not a valid DLS surface location
ENDIF.
WHEN proj-zznts.
lv_result = zcl_well=>check_nts_sr( location_id = proj-zzsurflocn ).
IF lv_result IS INITIAL.
MESSAGE e004(zwell). " Not a valid NTS surface location
ENDIF.
ENDCASE.
ENDIF.
ENDIF.
ENDMODULE. " check_0600_zsurflocn INPUT
&----
*& Module check_0600_zremsump INPUT
&----
Remote sump validation.
----
MODULE check_0600_zremsump INPUT.
IF proj-zzmulti_well IS NOT INITIAL.
IF proj-zzremsump IS NOT INITIAL.
CASE 'X'.
WHEN proj-zzdls.
lv_result = zcl_well=>check_dls_sr( location_id = proj-zzremsump ).
IF lv_result IS INITIAL.
MESSAGE e005(zwell). " Not a valid DLS remote sump
ENDIF.
WHEN proj-zznts.
lv_result = zcl_well=>check_nts_sr( location_id = proj-zzremsump ).
IF lv_result IS INITIAL.
MESSAGE e006(zwell). " Not a valid NTS remote sump
ENDIF.
ENDCASE.
ENDIF.
ENDIF.
ENDMODULE. " check_0600_zremsump INPUT
Kindly help pleaseeee.
Aarav