‎2014 Jul 07 10:14 AM
Hi All,
i have created a Screen having two subscreens, one having a table control wizards, whenever user puts any entries in it and presses enter button, it is creating a blank lines before that line, i need to stop it as i wants that when user enters any values in the table fields, and presses ENTER button, it should not create a blank line.
I am doing some stuffs in PAI , but not getting desired result, please tell me where should i code for the desired result. Here is the code of my PAI of that subscreen.
PROCESS AFTER INPUT.
LOOP AT G_ZTBC_2014_ITAB.
CHAIN.
FIELD ZPAYMENTS1-SNO.
FIELD ZPAYMENTS1-CDATE.
FIELD ZPAYMENTS1-CHEKNO.
FIELD ZPAYMENTS1-AMOUNT.
FIELD ZPAYMENTS1-BANKKEY.
MODULE ZTBC_2014_MODIFY ON CHAIN-REQUEST.
ENDCHAIN.
ENDLOOP.
One more problem what i am getting is that i have a drop down list which i have called from VRM_SET_VALUES, it has two values to be displayed, but each time i am using it, it increases my list , but it should be only two always, please tell me what can i do. My code is
MODULE DISPLAY_LIST OUTPUT.
wa_values-key = '1'.
wa_values-text = 'Direct'.
APPEND wa_values TO i_values.
wa_values-key = '2'.
wa_values-text = 'Indirect'.
APPEND wa_values TO i_values.
id_name = 'ZSDPROJECT1-TYPE'.
CALL FUNCTION 'VRM_SET_VALUES'
EXPORTING
ID = id_name
VALUES = i_values
EXCEPTIONS
ID_ILLEGAL_NAME = 1
OTHERS = 2.
IF SY-SUBRC <> 0.
* Implement suitable error handling here
ENDIF.
ENDMODULE.
‎2014 Jul 07 10:21 AM
Shweta,
MODULE ZTBC_2014_MODIFY ON CHAIN-REQUEST.
in module one append line.
comment that and check.
Regrding drop down list,
http://scn.sap.com/thread/1960601
regards,
Sandeep.
‎2014 Jul 07 10:31 AM
Hi ,
if i will comment the module ztbc_2014_modify on chain-request, it will disappeared the values entered on the screen-field, i am not getting your points, please clear it.
‎2014 Jul 07 10:35 AM
double click on that module.
then inside that one append line , comment that line.
‎2014 Jul 07 10:44 AM
Hi Sweatha,
use .
if i_values[] is initial .
start append the i_values.
endif.
this code will reduce increasing entries in list box.
for second thing u should debug the logic written by the standard code.
Regards,
Hiriyappa
‎2014 Jul 07 10:53 AM
Hi Sandeep,
i have already changes my code in that , please look at this code
MODULE ZTBC_2014_MODIFY INPUT.
MOVE-CORRESPONDING ZPAYMENTS1 TO G_ZTBC_2014_WA.
* MODIFY G_ZTBC_2014_ITAB
* FROM G_ZTBC_2014_WA
* INDEX ZTBC_2014-CURRENT_LINE.
APPEND G_ZTBC_2014_WA TO G_ZTBC_2014_ITAB.
CLEAR : G_ZTBC_2014_WA.
ENDMODULE.
‎2014 Jul 07 11:03 AM
1st thing is dont press each and every cell enter button, last cell press only.
and when you press save button that time use delete query to delete blank line from internal table.
Regards,
Sandeep
‎2014 Jul 07 11:09 AM
your second query,
add this line to start.
REFRESH Table_name .
MODULE DISPLAY_LIST OUTPUT.
REFRESH i_values.
wa_values-key = '1'.
wa_values-text = 'Direct'.
APPEND wa_values TO i_values.
wa_values-key = '2'.
wa_values-text = 'Indirect'.
APPEND wa_values TO i_values.
id_name = 'ZSDPROJECT1-TYPE'.
CALL FUNCTION 'VRM_SET_VALUES'
EXPORTING
ID = id_name
VALUES = i_values
EXCEPTIONS
ID_ILLEGAL_NAME = 1
OTHERS = 2.
IF SY-SUBRC <> 0.
* Implement suitable error handling here
ENDIF.
ENDMODULE.
hope it will helps.
regards,
Sandeep
‎2014 Jul 07 11:18 AM
Hi Sandeep,
we can't restrict user for any activities, we can't force them to do that, anyhow if i make a change as shown below, then i can restrict it for one entries
IF ZPAYMENTS1 IS NOT INITIAL.
MOVE-CORRESPONDING ZPAYMENTS1 TO G_ZTBC_2014_WA.
* MODIFY G_ZTBC_2014_ITAB
* FROM G_ZTBC_2014_WA
* INDEX ZTBC_2014-CURRENT_LINE.
APPEND G_ZTBC_2014_WA TO G_ZTBC_2014_ITAB.
ENDIF.
CLEAR : G_ZTBC_2014_WA.
but i want the sane for all the five fields, please tell me how could i achieve it for all table fields.
‎2014 Jul 07 11:22 AM
Hi Sandeep,
thanks one of my problem get resolved but again the problem of table control wizards still persist,
please tell me the required solution.
‎2014 Jul 07 11:57 AM
try this one,
IF ZPAYMENTS1-BANKKEY IS NOT INITIAL.
MOVE-CORRESPONDING ZPAYMENTS1 TO G_ZTBC_2014_WA.
* MODIFY G_ZTBC_2014_ITAB
* FROM G_ZTBC_2014_WA
* INDEX ZTBC_2014-CURRENT_LINE.
APPEND G_ZTBC_2014_WA TO G_ZTBC_2014_ITAB.
ENDIF.
CLEAR : G_ZTBC_2014_WA.
Regards,
Sandeep
‎2014 Jul 07 12:35 PM
Hi,
as i told you this will not work, as according to you if a user puts sno and cdate and presses ENTER
then the values will be disappeared, according to you , you have put checked on bankkey, but the user can press enter after any field.
IF ZPAYMENTS1-BANKKEY IS NOT INITIAL.
MOVE-CORRESPONDING ZPAYMENTS1 TO G_ZTBC_2014_WA.
APPEND G_ZTBC_2014_WA TO G_ZTBC_2014_ITAB.
ENDIF.
CLEAR : G_ZTBC_2014_WA.
when i have written this, then when i put sno and cdate, it disappears from my table field.
‎2014 Jul 07 12:44 PM
hi Shweta,
simple coding for that.
use sel field in your internal table
put logic in PAI part
loop at itab.
module insert_data.
under this put code
( if itab-sel is initial.
itab-sel = 'x'.
append itab.
else.
modify itab index tc_current-line.
endif.)
endloop
note :- sel field should be the part of internal table
hope it helps.
with regards,
vikas
‎2014 Jul 07 1:12 PM
Hi Vikas,
while creating my table control wizard, i haven't used SEL, so how could i use it.
‎2014 Jul 07 1:18 PM
you have to mention the sel field in your internal table
later that table name you can provide in wizard.
or if fields are less then create in manually...
you will learn new things
with regards,
vikas
‎2014 Jul 07 1:27 PM
Shweta,
check this link, how to use table control with wizards properly explained with screen shot,
http://www.saptechnical.com/Tutorials/ABAP/TableControl/Index.htm
there MARK is used for SEL.
Regards,
Sandeep
‎2014 Jul 07 10:38 AM
hi shweta,
your first query need more information to understand..
as per your second query kindly clear the work area.. or I Would suggest to use your fix value for drop down in the domain (value range) level.
hope it will help
regards,
vikas
‎2014 Jul 07 10:57 AM
Hi Vikas,
when i cleared the work area nothing changes.
i have fixed two values to show in output as Direct and Indirect, and for the same i have written the above mentioned code, but it repeats the values.
‎2014 Jul 07 11:08 AM
Hi,
Instead of clearing work area, refresh value table i,e
MODULE DISPLAY_LIST OUTPUT.
Refresh i_values[].
....
Regards
‎2014 Jul 07 11:19 AM
‎2014 Jul 07 12:45 PM
Hi Myageri,
please elaborate at some extent what are you saying, i am not getting properly. Here is the code i have written, please tell me the required changes i have to make.
MODULE ZTBC_2014_MODIFY INPUT.
IF ZPAYMENTS1-BANKKEY IS NOT INITIAL.
MOVE-CORRESPONDING ZPAYMENTS1 TO G_ZTBC_2014_WA.
MODULE ZTBC_2014_MODIFY INPUT.
IF ZPAYMENTS1-BANKKEY IS NOT INITIAL.
MOVE-CORRESPONDING ZPAYMENTS1 TO G_ZTBC_2014_WA.
‎2014 Jul 07 12:50 PM
Hi,
I think you have another " APPEND wa_values TO i_values " anywhere else (maybe in ZTBC_2014_MODIFY ON CHAIN-REQUEST or in any other places),
you have to put an IF conditien that if your WA is not initial, then appending happens.
Regards,
Farzin
‎2014 Jul 07 1:48 PM
‎2014 Jul 08 2:11 PM
Shweta,
I have create same scenario here and it is working fine.
when you press single ENTER that time not append any line after fill all row data that time press double ENTER.
and related to blank line
use below code
this is my program code.
MODULE TB_MARA_MODIFY INPUT.
APPEND WA_MARA TO GT_MARA .
DELETE gt_mara WHERE matnr is INITIAL.
clear: WA_MARA.
ENDMODULE.
note-> gt_mara is my internal table wa_mara is workarea.
same you do in your code.
MODULE ZTBC_2014_MODIFY INPUT.
APPEND ZPAYMENTS1 TO ZPAYMENTS1.
DELETE ZPAYMENTS1 WHERE cdate is INITIAL.
clear ZPAYMENTS1.
ENDMODULE.
I think your internal table name and workarea name same.
one more think as per my observation when you create table control wizards no need to select SEC column filed. this field only pass as index.
just follow this link
http://www.saptechnical.com/Tutorials/ABAP/TableControl/Page2.htm
hope you understand and it helps to you.
Regards,
Sandeep