Closing INDIVIDUAL lines for input in a table control
Right, hopefully I can explain my issue clearly enough to get an answer that will help me resolve this pain in the *** issue.
My table control has a delete function but the client doesn't want the line removed from the control table they simply want the line in question to be greyed out (closed for input). Has anyone achieved this in the past? I know it's possible to grey out columns but I can't see any way of doing individual lines.
For all answers that help me I will shout a beer provided you are in either Sydney or Adelaide.
Hi,
>
Neil Gardiner wrote:
> Right, hopefully I can explain my issue clearly enough to get an answer that will help me resolve this pain in the *** issue.
>
> My table control has a delete function but the client doesn't want the line removed from the control table they simply want the line in question to be greyed out (closed for input). Has anyone achieved this in the past? I know it's possible to grey out columns but I can't see any way of doing individual lines.
>
> For all answers that help me I will shout a beer provided you are in either Sydney or Adelaide.
Refer:-
it_zekpo is my internal table w/o header line,
wa_zekpo is work area.
Name of input/output fields on screen are:-
wa_zekpo-field1,
wa_zekpo-field2, and so on...
Add a field as flag(1) type c in the internal table and work area
And keep a name of SELCOL in the attributes of table control as wa_zekpo-flag
Take the group1 for all textboxes as 'ABC' in the table control
Try using code:-
At screen logic:
PROCESS BEFORE OUTPUT.
* MODULE status_8003.
LOOP WITH CONTROL po_tb.
MODULE read_data.
ENDLOOP.
PROCESS AFTER INPUT.
* MODULE user_command_8003.
LOOP WITH CONTROL po_tb.
MODULE modify_data.
ENDLOOP.
In PBO
*& Module READ_DATA OUTPUT
MODULE read_data OUTPUT.
READ TABLE it_zekpo INTO wa_zekpo INDEX po_tb-current_line. "po_tab is table control name
data : line_count type i.
describe it_zekpo
lines line_count.
po_tb-lines = line_count + 10.
"to increase the number of lines in table control dynamically
if sy-ucomm = 'DELETE'. "<--when user click delete button
if wa-zekpo-flag = 'X'. "<--if record selected
if screen-group1 = 'ABC'.
loop at screen.
screen-input = 0. "disable
screen-active = 0.
endloop.
modify screen.
endif.
else. "<--if record not selected
if screen-group1 = 'ABC'.
loop at screen.
screen-input = 1. "enable
screen-active = 1.
endloop.
modify screen.
endif.
endif.
endif.
ENDMODULE. " READ_DATA OUTPUT
In PAI
*& Module MODIFY_DATA INPUT
MODULE MODIFY_DATA INPUT.
MODIFY IT_ZEKPO FROM WA_ZEKPO INDEX po_tb-currentline.
"this will insert a new line
"and will modify the contents of existing line
ENDMODULE. " MODIFY_DATA INPUT
Hope this helps you.
Let mw know if you have any doubts.
Regards,
Tarun
Similar Messages
-
More than 1 line items in bdc using table controls for BOM
Hi....
how do u update more than one line item for BOM using BDC table control.......
is there any specific command for doing that.......
hav tried d following code bt it takes the flatfile i/p FOR 2 LINE ITEMS as 2 different BOM'S.....
would appreciate ur help....plz provide code.............
REPORT zbdc4_cs01
NO STANDARD PAGE HEADING LINE-SIZE 255.
INCLUDE bdcrecx1.
DATA : a TYPE i,
b type i,
c type i.
DATA : BEGIN OF it_rec OCCURS 0,
rec(200) TYPE c,
END OF it_rec.
DATA : BEGIN OF ctab OCCURS 0,
matnr(18),
werks(4),
stlan(1),
END OF ctab.
DATA : BEGIN OF xtab OCCURS 0,
idnrk(18),
menge(13),
postp(1),
END OF xtab.
DATA : BEGIN OF itab OCCURS 0,
matnr(18),
werks(4),
stlan(1),
idnrk(18),
menge(13),
postp(1),
END OF itab.
START-OF-SELECTION.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = 'C:/TEST4.TXT'
filetype = 'ASC'
has_field_separator = 'X'
TABLES
data_tab = it_rec.
LOOP AT it_rec.
a = strlen( it_rec-rec ).
if a = 55.
itab-matnr = it_rec-rec+0(18).
itab-werks = it_rec-rec+18(4).
itab-stlan = it_rec-rec+22(1).
itab-idnrk = it_rec-rec+23(18).
itab-menge = it_rec-rec+41(13).
itab-postp = it_rec-rec+54(1).
APPEND itab.
elseif a > 55.
itab-matnr = it_rec-rec+0(18).
itab-werks = it_rec-rec+18(4).
itab-stlan = it_rec-rec+22(1).
itab-idnrk = it_rec-rec+23(18).
itab-menge = it_rec-rec+41(13).
itab-postp = it_rec-rec+54(1).
APPEND itab.
itab-idnrk = it_rec-rec+55(18).
itab-menge = it_rec-rec+73(13).
itab-postp = it_rec-rec+86(1).
APPEND itab.
endif.
ENDLOOP.
PERFORM open_group.
LOOP AT itab.
PERFORM bdc_dynpro USING 'SAPLCSDI' '0100'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RC29N-STLAN'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'RC29N-MATNR'
itab-matnr. "'3000000107'.
PERFORM bdc_field USING 'RC29N-WERKS'
itab-werks. "'UN02'.
PERFORM bdc_field USING 'RC29N-STLAN'
itab-stlan. "'1'.
PERFORM bdc_field USING 'RC29N-STLAL'
PERFORM bdc_field USING 'RC29N-DATUV'
'11.08.2008'.
PERFORM bdc_dynpro USING 'SAPLCSDI' '0110'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'RC29K-BMENG'
'1'.
PERFORM bdc_field USING 'RC29K-STLST'
'1'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RC29K-EXSTL'.
PERFORM bdc_dynpro USING 'SAPLCSDI' '0111'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RC29K-LABOR'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_dynpro USING 'SAPLCSDI' '0140'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RC29P-POSTP(01)'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'RC29P-IDNRK(01)'
itab-idnrk. "'1000000232'.
PERFORM bdc_field USING 'RC29P-MENGE(01)'
itab-menge. "'100'.
PERFORM bdc_field USING 'RC29P-POSTP(01)'
itab-postp. "'L'.
PERFORM bdc_dynpro USING 'SAPLCSDI' '0130'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RC29P-POSNR'.
PERFORM bdc_field USING 'RC29P-POSNR'
'0010'.
PERFORM bdc_field USING 'RC29P-IDNRK'
'1000000232'.
PERFORM bdc_field USING 'RC29P-MENGE'
'100'.
PERFORM bdc_field USING 'RC29P-MEINS'
'KG'.
PERFORM bdc_dynpro USING 'SAPLCSDI' '0131'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RC29P-POTX1'.
PERFORM bdc_field USING 'RC29P-SANKA'
'X'.
PERFORM bdc_dynpro USING 'SAPLCSDI' '0140'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RC29P-POSNR(01)'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_dynpro USING 'SAPLCSDI' '0140'.
PERFORM bdc_field USING 'BDC_CURSOR'
'RC29P-POSNR(01)'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=FCBU'.
PERFORM bdc_transaction USING 'CS01'.
ENDLOOP.
PERFORM close_group.Hi
Check this sample code for the Table Control in BDC:
data: fnam(20) type c.
move 1 to id.
loop at TI_STAGING WHERE VENDOR = IT_STAGING-VENDOR AND DOCDATE = IT_STAGING-DOCDATE.
concatenate 'RM06E-EPSTP(0' id ')' into fnam.
perform bdc_field using fnam TI_STAGING-itmcategory.
concatenate 'EKPO-KNTTP(0' id ')' into fnam.
perform bdc_field using fnam TI_STAGING-accassignment.
concatenate 'EKPO-EMATN(0' id ')' into fnam.
perform bdc_field using fnam TI_STAGING-material.
concatenate 'EKPO-TXZ01(0' id ')' into fnam.
perform bdc_field using fnam TI_STAGING-shortxt.
quan = ti_staging-poqty.
concatenate 'EKPO-MENGE(0' id ')' into fnam.
perform bdc_field using fnam quan.
concatenate 'RM06E-EEIND(0' id ')' into fnam.
perform bdc_field using fnam TI_STAGING-deliverydate.
netpr = ti_staging-netpr.
concatenate 'EKPO-NETPR(0' id ')' into fnam.
perform bdc_field using fnam netpr.
concatenate 'EKPO-MATKL(0' id ')' into fnam.
perform bdc_field using fnam TI_STAGING-mategroup.
concatenate 'EKPO-WERKS(0' id ')' into fnam.
perform bdc_field using fnam TI_STAGING-plant.
ID = ID + 1.
ENDLOOP.
Regards,
Vishwa. -
How to create Search Help for a field in Table control !!
Hello Friends,
I like to know - How to create Search Help for a field in Table control. Is it possible, if it is please share ur knowledge, I wud be happy if U provide some source code example for this.
Thanks,
SenthilCheck the sample code:
*& Include ZSRO_MPRN_SEARCH *
MODULE PSTLZ_F4 INPUT
MODULE pstlz_f4 INPUT.
reading post code
DATA: stepl TYPE systepl,
stepl_index TYPE systepl.
CLEAR: stepl, stepl_index.
CLEAR: lt_returntab,lt_dynpfields,i_mprn1.
REFRESH: lt_returntab,lt_dynpfields,i_mprn1.
lt_dynpfields-fieldname = 'I_MPRN-POST_CODE'.
lt_dynpfields-stepl = stepl.
APPEND lt_dynpfields. CLEAR lt_dynpfields.
CALL FUNCTION 'DYNP_VALUES_READ'
EXPORTING
dyname = sy-repid
dynumb = sy-dynnr
translate_to_upper = c_x
determine_loop_index = c_x
TABLES
dynpfields = lt_dynpfields
EXCEPTIONS
invalid_abapworkarea = 1
invalid_dynprofield = 2
invalid_dynproname = 3
invalid_dynpronummer = 4
invalid_request = 5
no_fielddescription = 6
invalid_parameter = 7
undefind_error = 8
double_conversion = 9
stepl_not_found = 10
OTHERS = 11.
IF sy-subrc EQ 0.
READ TABLE lt_dynpfields INDEX 1.
ENDIF.
ws_outcode = lt_dynpfields-fieldvalue.
stepl_index = lt_dynpfields-stepl.
REPLACE '*' WITH ' ' INTO lt_dynpfields-fieldvalue.
IF NOT lt_dynpfields-fieldvalue IS INITIAL.
MOVE lt_dynpfields-fieldvalue TO ws_outcode.
ws_len = STRLEN( lt_dynpfields-fieldvalue ).
IF ws_len GE 7.
ws_len = ws_len - 3.
ws_icode = ws_code+ws_len(3).
lt_dynpfields-fieldvalue = lt_dynpfields-fieldvalue+0(ws_len).
CONCATENATE lt_dynpfields-fieldvalue '%'
INTO ws_outcode.
CONDENSE lt_dynpfields-fieldvalue.
REPLACE ws_icode WITH ' ' INTO lt_dynpfields-fieldvalue.
ELSE.
CONCATENATE lt_dynpfields-fieldvalue+0(4) '%'
INTO ws_outcode.
ENDIF.
ws_ocode = ws_code+0(3).
ENDIF.
reading MPRN
CLEAR: lt_returntab,lt_dnpfields,i_mprn1.
REFRESH: lt_returntab,lt_dnpfields,i_mprn1.
lt_dnpfields-fieldname = 'I_MPRN-MPRN'.
lt_dnpfields-stepl = stepl_index.
APPEND lt_dnpfields. CLEAR lt_dnpfields.
CALL FUNCTION 'DYNP_VALUES_READ'
EXPORTING
dyname = sy-repid
dynumb = sy-dynnr
translate_to_upper = 'X'
TABLES
dynpfields = lt_dnpfields
EXCEPTIONS
invalid_abapworkarea = 1
invalid_dynprofield = 2
invalid_dynproname = 3
invalid_dynpronummer = 4
invalid_request = 5
no_fielddescription = 6
invalid_parameter = 7
undefind_error = 8
double_conversion = 9
stepl_not_found = 10
OTHERS = 11.
IF sy-subrc EQ 0.
READ TABLE lt_dnpfields INDEX 1.
ENDIF.
MPRN blank and Post code exist
IF lt_dnpfields-fieldvalue IS INITIAL.
IF NOT lt_dynpfields-fieldvalue IS INITIAL.
SELECT mprn ser_num sub_bud bud_name del_pt_alias
bud_num dep_street prin_street dbl_dep_street
dep_locty post_town county outcode incode
lg_site_ind file_date FROM zspa_mprn INTO
CORRESPONDING FIELDS OF TABLE i_mprn1
WHERE outcode LIKE ws_outcode.
ELSE.
MPRN blank and Post code blank
SELECT mprn ser_num sub_bud bud_name del_pt_alias
bud_num dep_street prin_street dbl_dep_street
dep_locty post_town county outcode incode
lg_site_ind file_date FROM zspa_mprn INTO
CORRESPONDING FIELDS OF TABLE i_mprn1.
ENDIF.
ELSE.
MPRN exist and Post code exist
IF NOT lt_dynpfields-fieldvalue IS INITIAL.
SELECT mprn ser_num sub_bud bud_name del_pt_alias
bud_num dep_street prin_street dbl_dep_street
dep_locty post_town county outcode incode
lg_site_ind file_date FROM zspa_mprn INTO
CORRESPONDING FIELDS OF TABLE i_mprn1
WHERE outcode LIKE ws_outcode AND
mprn EQ lt_dnpfields-fieldvalue.
ELSE.
MPRN exist and Post code blank
SELECT mprn ser_num sub_bud bud_name del_pt_alias
bud_num dep_street prin_street dbl_dep_street
dep_locty post_town county outcode incode
lg_site_ind file_date FROM zspa_mprn INTO
CORRESPONDING FIELDS OF TABLE i_mprn1
WHERE mprn EQ lt_dnpfields-fieldvalue.
ENDIF.
ENDIF.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'MPRN'
dynpprog = sy-repid
dynpnr = sy-dynnr
window_title = 'Select MPRN'
value_org = 'S'
TABLES
value_tab = i_mprn1 "lt_mprn
return_tab = lt_returntab
EXCEPTIONS
parameter_error = 1
no_values_found = 2
OTHERS = 3.
IF sy-subrc EQ 0.
READ TABLE lt_returntab INDEX 1.
READ TABLE i_mprn1 WITH KEY mprn = lt_returntab-fieldval.
IF sy-subrc EQ 0.
Updating post code
CONCATENATE i_mprn1-outcode i_mprn1-incode
INTO ws_postcode
SEPARATED BY space.
MOVE ws_postcode TO i_mprn-post_code.
CLEAR : i_dnpfld,
ws_dynpfld.
REFRESH : i_dnpfld.
ws_dyname = 'ZSRO_MASTER_DATA'.
ws_dynumb = '0301'.
ws_dynpfld-fieldname ='I_MPRN-POST_CODE'.
ws_dynpfld-fieldvalue = ws_postcode .
ws_dynpfld-stepl = stepl_index.
APPEND ws_dynpfld TO i_dnpfld.
CALL FUNCTION 'DYNP_VALUES_UPDATE'
EXPORTING
dyname = ws_dyname
dynumb = ws_dynumb
TABLES
dynpfields = i_dnpfld
EXCEPTIONS
invalid_abapworkarea = 1
invalid_dynprofield = 2
invalid_dynproname = 3
invalid_dynpronummer = 4
invalid_request = 5
no_fielddescription = 6
undefind_error = 7
OTHERS = 8.
IF sy-subrc <> 0.
ENDIF.
Updating MPRN
MOVE i_mprn1-mprn TO i_mprn-mprn.
CLEAR : i_dnpfld,
ws_dynpfld.
REFRESH : i_dnpfld.
ws_dyname = 'ZSRO_MASTER_DATA'.
ws_dynumb = '0301'.
ws_dynpfld-fieldname ='I_MPRN-MPRN'.
ws_dynpfld-fieldvalue = i_mprn1-mprn .
ws_dynpfld-stepl = stepl_index.
APPEND ws_dynpfld TO i_dnpfld.
CALL FUNCTION 'DYNP_VALUES_UPDATE'
EXPORTING
dyname = ws_dyname
dynumb = ws_dynumb
TABLES
dynpfields = i_dnpfld
EXCEPTIONS
invalid_abapworkarea = 1
invalid_dynprofield = 2
invalid_dynproname = 3
invalid_dynpronummer = 4
invalid_request = 5
no_fielddescription = 6
undefind_error = 7
OTHERS = 8.
IF sy-subrc <> 0.
ENDIF.
ENDIF.
ELSEIF sy-subrc EQ 2.
MESSAGE s005(zspa) WITH ws_postcode .
ENDIF.
ENDMODULE. "PSTLZ_F4 INPUT
MODULE MPRN_F4 INPUT
MODULE mprn_f4 INPUT.
reading post code
DATA: stepl TYPE systepl,
stepl_index TYPE systepl.
CLEAR: stepl, stepl_index.
CLEAR: lt_returntab,lt_dynpfields,i_mprn1.
REFRESH: lt_returntab,lt_dynpfields,i_mprn1.
lt_dynpfields-fieldname = 'I_MPRN-POST_CODE'.
lt_dynpfields-stepl = stepl.
APPEND lt_dynpfields. CLEAR lt_dynpfields.
CALL FUNCTION 'DYNP_VALUES_READ'
EXPORTING
dyname = sy-repid
dynumb = sy-dynnr
translate_to_upper = c_x
determine_loop_index = c_x
TABLES
dynpfields = lt_dynpfields
EXCEPTIONS
invalid_abapworkarea = 1
invalid_dynprofield = 2
invalid_dynproname = 3
invalid_dynpronummer = 4
invalid_request = 5
no_fielddescription = 6
invalid_parameter = 7
undefind_error = 8
double_conversion = 9
stepl_not_found = 10
OTHERS = 11.
IF sy-subrc EQ 0.
READ TABLE lt_dynpfields INDEX 1.
ENDIF.
ws_outcode = lt_dynpfields-fieldvalue.
stepl_index = lt_dynpfields-stepl.
REPLACE '*' WITH ' ' INTO lt_dynpfields-fieldvalue.
IF NOT lt_dynpfields-fieldvalue IS INITIAL.
MOVE lt_dynpfields-fieldvalue TO ws_outcode.
ws_len = STRLEN( lt_dynpfields-fieldvalue ).
IF ws_len GE 7.
ws_len = ws_len - 3.
ws_icode = ws_code+ws_len(3).
lt_dynpfields-fieldvalue = lt_dynpfields-fieldvalue+0(ws_len).
CONCATENATE lt_dynpfields-fieldvalue '%'
INTO ws_outcode.
CONDENSE lt_dynpfields-fieldvalue.
REPLACE ws_icode WITH ' ' INTO lt_dynpfields-fieldvalue.
ELSE.
CONCATENATE lt_dynpfields-fieldvalue+0(4) '%'
INTO ws_outcode.
ENDIF.
ws_ocode = ws_code+0(3).
ENDIF.
reading MPRN
CLEAR: lt_returntab,lt_dnpfields,i_mprn1.
REFRESH: lt_returntab,lt_dnpfields,i_mprn1.
lt_dnpfields-fieldname = 'I_MPRN-MPRN'.
lt_dnpfields-stepl = stepl_index.
APPEND lt_dnpfields. CLEAR lt_dnpfields.
CALL FUNCTION 'DYNP_VALUES_READ'
EXPORTING
dyname = sy-repid
dynumb = sy-dynnr
translate_to_upper = 'X'
TABLES
dynpfields = lt_dnpfields
EXCEPTIONS
invalid_abapworkarea = 1
invalid_dynprofield = 2
invalid_dynproname = 3
invalid_dynpronummer = 4
invalid_request = 5
no_fielddescription = 6
invalid_parameter = 7
undefind_error = 8
double_conversion = 9
stepl_not_found = 10
OTHERS = 11.
IF sy-subrc EQ 0.
READ TABLE lt_dnpfields INDEX 1.
ENDIF.
MPRN blank and Post code exist
IF lt_dnpfields-fieldvalue IS INITIAL.
IF NOT lt_dynpfields-fieldvalue IS INITIAL.
SELECT mprn ser_num sub_bud bud_name del_pt_alias
bud_num dep_street prin_street dbl_dep_street
dep_locty post_town county outcode incode
lg_site_ind file_date FROM zspa_mprn INTO
CORRESPONDING FIELDS OF TABLE i_mprn1
WHERE outcode LIKE ws_outcode.
ELSE.
MPRN blank and Post code blank
SELECT mprn ser_num sub_bud bud_name del_pt_alias
bud_num dep_street prin_street dbl_dep_street
dep_locty post_town county outcode incode
lg_site_ind file_date FROM zspa_mprn INTO
CORRESPONDING FIELDS OF TABLE i_mprn1.
ENDIF.
ELSE.
MPRN exist and Post code exist
IF NOT lt_dynpfields-fieldvalue IS INITIAL.
SELECT mprn ser_num sub_bud bud_name del_pt_alias
bud_num dep_street prin_street dbl_dep_street
dep_locty post_town county outcode incode
lg_site_ind file_date FROM zspa_mprn INTO
CORRESPONDING FIELDS OF TABLE i_mprn1
WHERE outcode LIKE ws_outcode AND
mprn EQ lt_dnpfields-fieldvalue.
ELSE.
MPRN exist and Post code blank
SELECT mprn ser_num sub_bud bud_name del_pt_alias
bud_num dep_street prin_street dbl_dep_street
dep_locty post_town county outcode incode
lg_site_ind file_date FROM zspa_mprn INTO
CORRESPONDING FIELDS OF TABLE i_mprn1
WHERE mprn EQ lt_dnpfields-fieldvalue.
ENDIF.
ENDIF.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'MPRN'
dynpprog = sy-repid
dynpnr = sy-dynnr
window_title = 'Select MPRN'
value_org = 'S'
TABLES
value_tab = i_mprn1 "lt_mprn
return_tab = lt_returntab
EXCEPTIONS
parameter_error = 1
no_values_found = 2
OTHERS = 3.
IF sy-subrc EQ 0.
READ TABLE lt_returntab INDEX 1.
READ TABLE i_mprn1 WITH KEY mprn = lt_returntab-fieldval.
IF sy-subrc EQ 0.
Updating MPRN
MOVE i_mprn1-mprn TO i_mprn-mprn.
CLEAR : i_dnpfld,
ws_dynpfld.
REFRESH : i_dnpfld.
ws_dyname = 'ZSRO_MASTER_DATA'.
ws_dynumb = '0301'.
ws_dynpfld-fieldname ='I_MPRN-MPRN'.
ws_dynpfld-fieldvalue = i_mprn1-mprn .
ws_dynpfld-stepl = stepl_index.
APPEND ws_dynpfld TO i_dnpfld.
**code changed by laxman 10.08.2005
ws_dynpfld-stepl = mprn-current_line.
**code changed by laxman 10.08.2005
CALL FUNCTION 'DYNP_VALUES_UPDATE'
EXPORTING
dyname = ws_dyname
dynumb = ws_dynumb
TABLES
dynpfields = i_dnpfld
EXCEPTIONS
invalid_abapworkarea = 1
invalid_dynprofield = 2
invalid_dynproname = 3
invalid_dynpronummer = 4
invalid_request = 5
no_fielddescription = 6
undefind_error = 7
OTHERS = 8.
IF sy-subrc <> 0.
ENDIF.
Updating post code
CONCATENATE i_mprn1-outcode i_mprn1-incode
INTO ws_postcode
SEPARATED BY space.
MOVE ws_postcode TO i_mprn-post_code.
CLEAR : i_dnpfld,
ws_dynpfld.
REFRESH : i_dnpfld.
ws_dyname = 'ZSRO_MASTER_DATA'.
ws_dynumb = '0301'.
ws_dynpfld-fieldname ='I_MPRN-POST_CODE'.
ws_dynpfld-fieldvalue = ws_postcode .
ws_dynpfld-stepl = stepl_index.
APPEND ws_dynpfld TO i_dnpfld.
**code changed by laxman 10.08.2005
break gblap0.
ws_dynpfld-stepl = mprn-current_line.
LOOP AT i_mprn.
MOVE i_mprn1-mprn TO i_mprn-mprn.
MOVE ws_postcode TO i_mprn-post_code.
MODIFY i_mprn INDEX
mprn-current_line." transporting MPRN POST_CODE.
ENDLOOP.
**code changed by laxman 10.08.2005
CALL FUNCTION 'DYNP_VALUES_UPDATE'
EXPORTING
dyname = ws_dyname
dynumb = ws_dynumb
TABLES
dynpfields = i_dnpfld
EXCEPTIONS
invalid_abapworkarea = 1
invalid_dynprofield = 2
invalid_dynproname = 3
invalid_dynpronummer = 4
invalid_request = 5
no_fielddescription = 6
undefind_error = 7
OTHERS = 8.
IF sy-subrc <> 0.
ENDIF.
ENDIF.
ELSEIF sy-subrc EQ 2.
MESSAGE s006(zspa) WITH i_mprn1-mprn .
ENDIF.
ENDMODULE. "MPRN_F4 INPUT
MODULE GNTC_F4 INPUT
MODULE gntc_f4 INPUT.
DATA: BEGIN OF lt_gntc OCCURS 0,
gntc LIKE iflot-zzgntc,
END OF lt_gntc.
CLEAR: lt_returntab, lt_gntc.
REFRESH: lt_returntab, lt_gntc.
lt_gntc-gntc = 'DM'.
APPEND lt_gntc. CLEAR lt_gntc.
lt_gntc-gntc = 'NDM'.
APPEND lt_gntc. CLEAR lt_gntc.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'ZZGNTC'
dynpprog = sy-repid
dynpnr = sy-dynnr
window_title = 'Select Gas Nomination Type Code'
value_org = 'S'
TABLES
value_tab = lt_gntc
return_tab = lt_returntab
EXCEPTIONS
parameter_error = 1
no_values_found = 2
OTHERS = 3.
IF sy-subrc EQ 0.
READ TABLE lt_returntab INDEX 1.
i_mprn-dm_ndm = lt_returntab-fieldval.
ENDIF.
ENDMODULE. "GNTC_F4 INPUT
*& Module mprn1_f4 INPUT
text
MODULE mprn1_f4 INPUT.
DATA: lt_f4 TYPE ddshretval OCCURS 0 WITH HEADER LINE,
lt_returntab1 LIKE ddshretval OCCURS 0 WITH HEADER LINE,
lt_dynpfields1 LIKE dynpread OCCURS 0 WITH HEADER LINE,
lt_dnpfields1 LIKE dynpread OCCURS 0 WITH HEADER LINE.
DATA: stepl1 TYPE systepl,
stepl_index1 TYPE systepl.
DATA : i_dnpfld1 LIKE dynpread OCCURS 0 WITH HEADER LINE,
ws_dyname1 LIKE d020s-prog,
ws_dynumb1 LIKE d020s-dnum,
ws_dynpfld1 LIKE dynpread.
CLEAR: i_dnpfld1, ws_dyname1, ws_dynumb1, ws_dynpfld1,
lt_f4, lt_returntab1,lt_dynpfields1, lt_f4,
stepl1, stepl_index1.
REFRESH: i_dnpfld1, lt_returntab1,lt_dynpfields1, lt_f4.
To Determine Steploop Index
lt_dynpfields1-fieldname = 'I_MPRN-POST_CODE'.
lt_dynpfields1-stepl = stepl1.
APPEND lt_dynpfields1. CLEAR lt_dynpfields1.
CALL FUNCTION 'DYNP_VALUES_READ'
EXPORTING
dyname = sy-repid
dynumb = sy-dynnr
translate_to_upper = 'X'
determine_loop_index = 'X'
TABLES
dynpfields = lt_dynpfields1
EXCEPTIONS
invalid_abapworkarea = 1
invalid_dynprofield = 2
invalid_dynproname = 3
invalid_dynpronummer = 4
invalid_request = 5
no_fielddescription = 6
invalid_parameter = 7
undefind_error = 8
double_conversion = 9
stepl_not_found = 10
OTHERS = 11.
IF sy-subrc EQ 0.
READ TABLE lt_dynpfields1 INDEX 1.
ENDIF.
stepl_index1 = lt_dynpfields1-stepl.
CALL FUNCTION 'F4IF_FIELD_VALUE_REQUEST'
EXPORTING
tabname = 'IFLOT'
fieldname = 'I_MPRN-MPRN'
searchhelp = 'ZS_MPRN_PC'
dynpprog = sy-repid
dynpnr = sy-dynnr
TABLES
return_tab = lt_f4
EXCEPTIONS
field_not_found = 1
no_help_for_field = 2
inconsistent_help = 3
no_values_found = 4
OTHERS = 5.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
Update tablecontrol
READ TABLE lt_f4 WITH KEY fieldname = 'MPRN'.
IF sy-subrc = 0.
MOVE lt_f4-fieldval TO i_mprn-mprn.
ws_dyname1 = 'ZSRO_MASTER_DATA'.
ws_dynumb1 = '0301'.
ws_dynpfld1-fieldname ='I_MPRN-MPRN'.
ws_dynpfld1-fieldvalue = i_mprn-mprn.
ws_dynpfld1-stepl = stepl_index1.
APPEND ws_dynpfld1 TO i_dnpfld1.
CALL FUNCTION 'DYNP_VALUES_UPDATE'
EXPORTING
dyname = ws_dyname1
dynumb = ws_dynumb1
TABLES
dynpfields = i_dnpfld1
EXCEPTIONS
invalid_abapworkarea = 1
invalid_dynprofield = 2
invalid_dynproname = 3
invalid_dynpronummer = 4
invalid_request = 5
no_fielddescription = 6
undefind_error = 7
OTHERS = 8.
IF sy-subrc <> 0.
ENDIF.
ENDIF.
CLEAR : i_dnpfld1, ws_dynpfld1.
REFRESH: i_dnpfld1.
READ TABLE lt_f4 WITH KEY fieldname = 'ZZPSTLZ'.
IF sy-subrc = 0.
MOVE lt_f4-fieldval TO i_mprn-post_code.
ws_dyname1 = 'ZSRO_MASTER_DATA'.
ws_dynumb1 = '0301'.
ws_dynpfld1-fieldname ='I_MPRN-POST_CODE'.
ws_dynpfld1-fieldvalue = i_mprn-post_code.
ws_dynpfld1-stepl = stepl_index1.
APPEND ws_dynpfld1 TO i_dnpfld1.
CALL FUNCTION 'DYNP_VALUES_UPDATE'
EXPORTING
dyname = ws_dyname1
dynumb = ws_dynumb1
TABLES
dynpfields = i_dnpfld1
EXCEPTIONS
invalid_abapworkarea = 1
invalid_dynprofield = 2
invalid_dynproname = 3
invalid_dynpronummer = 4
invalid_request = 5
no_fielddescription = 6
undefind_error = 7
OTHERS = 8.
IF sy-subrc <> 0.
ENDIF.
ENDIF.
ENDMODULE. " mprn1_f4 INPUT
*& Module pstlz1_f4 INPUT
text
MODULE pstlz1_f4 INPUT.
CLEAR: i_dnpfld1, ws_dyname1, ws_dynumb1, ws_dynpfld1,
lt_f4, lt_returntab1,lt_dynpfields1, lt_f4,
stepl1, stepl_index1.
REFRESH: i_dnpfld1, lt_returntab1,lt_dynpfields1, lt_f4.
To Determine Steploop Index
lt_dynpfields1-fieldname = 'I_MPRN-MPRN'.
lt_dynpfields1-stepl = stepl1.
APPEND lt_dynpfields1. CLEAR lt_dynpfields1.
CALL FUNCTION 'DYNP_VALUES_READ'
EXPORTING
dyname = sy-repid
dynumb = sy-dynnr
translate_to_upper = 'X'
determine_loop_index = 'X'
TABLES
dynpfields = lt_dynpfields1
EXCEPTIONS
invalid_abapworkarea = 1
invalid_dynprofield = 2
invalid_dynproname = 3
invalid_dynpronummer = 4
invalid_request = 5
no_fielddescription = 6
invalid_parameter = 7
undefind_error = 8
double_conversion = 9
stepl_not_found = 10
OTHERS = 11.
IF sy-subrc EQ 0.
READ TABLE lt_dynpfields1 INDEX 1.
ENDIF.
stepl_index1 = lt_dynpfields1-stepl.
CALL FUNCTION 'F4IF_FIELD_VALUE_REQUEST'
EXPORTING
tabname = 'IFLOT'
fieldname = 'I_MPRN-POST_CODE'
searchhelp = 'ZS_MPRN_PC'
dynpprog = sy-repid
dynpnr = sy-dynnr
TABLES
return_tab = lt_f4
EXCEPTIONS
field_not_found = 1
no_help_for_field = 2
inconsistent_help = 3
no_values_found = 4
OTHERS = 5.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
Update tablecontrol
READ TABLE lt_f4 WITH KEY fieldname = 'ZZPSTLZ'.
IF sy-subrc = 0.
MOVE lt_f4-fieldval TO i_mprn-post_code.
ws_dyname1 = 'ZSRO_MASTER_DATA'.
ws_dynumb1 = '0301'.
ws_dynpfld1-fieldname ='I_MPRN-POST_CODE'.
ws_dynpfld1-fieldvalue = i_mprn-post_code.
ws_dynpfld1-stepl = stepl_index1.
APPEND ws_dynpfld1 TO i_dnpfld1.
CALL FUNCTION 'DYNP_VALUES_UPDATE'
EXPORTING
dyname = ws_dyname1
dynumb = ws_dynumb1
TABLES
dynpfields = i_dnpfld1
EXCEPTIONS
invalid_abapworkarea = 1
invalid_dynprofield = 2
invalid_dynproname = 3
invalid_dynpronummer = 4
invalid_request = 5
no_fielddescription = 6
undefind_error = 7
OTHERS = 8.
IF sy-subrc <> 0.
ENDIF.
ENDIF.
CLEAR : i_dnpfld1, ws_dynpfld1.
REFRESH: i_dnpfld1.
READ TABLE lt_f4 WITH KEY fieldname = 'MPRN'.
IF sy-subrc = 0.
MOVE lt_f4-fieldval TO i_mprn-mprn.
ws_dyname1 = 'ZSRO_MASTER_DATA'.
ws_dynumb1 = '0301'.
ws_dynpfld1-fieldname ='I_MPRN-MPRN'.
ws_dynpfld1-fieldvalue = i_mprn-mprn.
ws_dynpfld1-stepl = stepl_index1.
APPEND ws_dynpfld1 TO i_dnpfld1.
CALL FUNCTION 'DYNP_VALUES_UPDATE'
EXPORTING
dyname = ws_dyname1
dynumb = ws_dynumb1
TABLES
dynpfields = i_dnpfld1
EXCEPTIONS
invalid_abapworkarea = 1
invalid_dynprofield = 2
invalid_dynproname = 3
invalid_dynpronummer = 4
invalid_request = 5
no_fielddescription = 6
undefind_error = 7
OTHERS = 8.
IF sy-subrc <> 0.
ENDIF.
ENDIF.
ENDMODULE. " pstlz1_f4 INPUT
Regards,
Prakash. -
Hi All, Pls send me the recording for va01 by handling table control
Hi All, Pls send me the recording for va01 by handling table control with 3 or more materials. Pls send me a flat file and code ASAP.
Thanks®ards.
BharatHere is a example of similar kind ..plz go through this doc..it will be help hul 4 u
How to deal with table control / step loop in BDC?
Steploop and table contol is inevitable in certain transactions. When we run BDC for such transactions, we will face the situation: how many visible lines of steploop/tablecontrol are on the screen? Although we can always find certain method to deal with it, such as function code 'NP', 'POPO', considering some extreme situation: there is only one line visible one the screen,
our BDC program should display an error message. (See transaction 'ME21', we you resize your screen to let only one row visible, you can not enter mutiple lines on this screen even you use 'NP')
Now, I find a method with which we can determine the number of visible lines on Transaction Screen from our Calling BDC program. Maybe it is useless to you, but I think it will give your some idea.
Demo ABAP code has two purposes:
1. how to determine number of visible lines and how to calculte page number; (the 'calpage' routine has been modify to meet general purpose usage)
2. using field symbol in BDC program, please pay special attention to the difference in Static
ASSIGN and Dynamic ASSIGN.
Now I begin to describe the step to implement my method:
(I use transaction 'ME21', screen 121 for sample, the method using is Call Transation Using..)
Step1: go to screen painter to display the screen 121, then we can count the fixed line on this screen, there is 7 lines above the steploop and 2 lines below the steploop, so there are total 9 fixed lines on this screen. This means except these 9 lines, all the other line is for step loop.
Then have a look at steploop itselp, one entry of it will occupy two lines.
(Be careful, for table control, the head and the bottom scroll bar will possess another two fixed lines, and there is a maximum number for table line)
Now we have : FixedLine = 9
LoopLine = 2(for table control, LoopLine is always equal to 1)
Step2: go to transaction itself(ME21) to see how it roll page, in ME21, the first line of new page is always occupied by the last line of last page, so it begin with index '02', but in some other case, fisrt line is empty and ready for input.
Now we have: FirstLine = 0
or FirstLine = 1 ( in our case, FirstLine is 1 because the first line of new page is fulfilled)
Step3: write a subroutine calcalculating number of pages
(here, the name of actual parameter is the same as formal parameter)
global data: FixedLine type i, " number of fixed line on a certain screen
LoopLine type i, " the number of lines occupied by one steploop item
FirstLine type i, " possbile value 0 or 1, 0 stand for the first line of new
" scrolling screen is empty, otherwise is 1
Dataline type i, " number of items you will use in BDC, using DESCRIBE to get
pageno type i, " you need to scroll screen how many times.
line type i, " number of lines appears on the screen.
index(2) type N, " the screen index for certain item
begin type i, " from parameter of loop
end type i. " to parameter of loop
*in code sample, the DataTable-linindex stands for the table index number of this line
form calpage using FixedLine type i (see step 1)
LoopLine type i (see step 1)
FirstLine type i (see step 2)
DataLine type i ( this is the item number you will enter in transaction)
changing pageno type i (return the number of page, depends on run-time visible line in table control/ Step Loop)
changing line type i.(visible lines one the screen)
data: midd type i,
vline type i, "visible lines
if DataLine eq 0.
Message eXXX.
endif.
vline = ( sy-srows - FixedLine ) div LoopLine.
*for table control, you should compare vline with maximum line of
*table control, then take the small one that is min(vline, maximum)
*here only illustrate step loop
if FirstLine eq 0.
pageno = DataLine div vline.
if pageno eq 0.
pageno = pageno + 1.
endif.
elseif FirstLine eq 1.
pageno = ( DataLine - 1 ) div ( vline - 1 ) + 1.
midd = ( DataLine - 1 ) mod ( vline - 1).
if midd = 0 and DataLine gt 1.
pageno = pageno - 1.
endif.
endif.
line = vline.
endform.
Step4 write a subroutine to calculate the line index for each item.
form calindex using Line type i (visible lines on the screen)
FirstLine type i(see step 2)
LineIndex type i(item index)
changing Index type n. (index on the screen)
if FirstLine = 0.
index = LineIndex mod Line.
if index = '00'.
index = Line.
endif.
elseif FirstLine = 1.
index = LineIndex mod ( Line - 1 ).
if ( index between 1 and 0 ) and LineIndex gt 1.
index = index + Line - 1.
endif.
if Line = 2.
index = index + Line - 1.
endif.
endif.
endform.
Step5 write a subroutine to calculate the loop range.
form calrange using Line type i ( visible lines on the screen)
DataLine type i
FirstLine type i
loopindex like sy-index
changing begin type i
end type i.
If FirstLine = 0.
if loopindex = 1.
begin = 1.
if DataLine <= Line.
end = DataLine.
else.
end = Line.
endif.
elseif loopindex gt 1.
begin = Line * ( loopindex - 1 ) + 1.
end = Line * loopindex.
if end gt DataLine.
end = DataLine.
endif.
endif.
elseif FirstLine = 1.
if loopindex = 1.
begin = 1.
if DataLine <= Line.
end = DataLine.
else.
end = Line.
endif.
elseif loop index gt 1.
begin = ( Line - 1 ) * ( loopindex - 1 ) + 2.
end = ( Line - 1 ) * ( loopindex - 1 ) + Line.
if end gt DataLine.
end = DataLine.
endif.
endif.
endif.
endform.
Step6 using field sysbol in your BDC, for example: in ME21, but you should calculate each item will correponding to which index
form creat_bdc.
field-symbols: <material>, <quan>, <indicator>.
data: name1(14) value 'EKPO-EMATN(XX)',
name2(14) value 'EKPO-MENGE(XX)',
name3(15) value 'RM06E-SELKZ(XX)'.
assign: name1 to <material>,
name2 to <quan>,
name3 to <indicator>.
do pageno times.
if sy-index gt 1
*insert scroll page ok_code"
endif.
perform calrange using Line DataLine FirstLine sy-index
changing begin end.
loop at DataTable from begin to end.
perform calindex using Line FirstLine DataTable-LineIndex changing Index.
name1+11(2) = Index.
name2+11(2) = Index.
name3+12(2) = Index.
perform bdcfield using <material> DataTable-matnr.
perform bdcfield using <quan> DataTable-menge.
perform bdcfield using <indicator> DataTable-indicator.
endloop.
enddo.
Sample code
Following is a sample code of handling table control in BDC.
REPORT Y730_BDC5 .
*HANDLING TABLE CONTROL IN BDC
DATA : BEGIN OF IT_DUMMY OCCURS 0,
DUMMY(100) TYPE C,
END OF IT_DUMMY.
DATA : BEGIN OF IT_XK01 OCCURS 0,
LIFNR(10) TYPE C,
BUKRS(4) TYPE C,
EKORG(4) TYPE C,
KTOKK(4) TYPE C,
NAME1(30) TYPE C,
SORTL(10) TYPE C,
LAND1(3) TYPE C,
SPRAS(2) TYPE C,
AKONT(6) TYPE C,
FDGRV(2) TYPE C,
WAERS(3) TYPE C,
END OF IT_XK01,
BEGIN OF IT_BANK OCCURS 0,
BANKS(3) TYPE C,
BANKL(10) TYPE C,
BANKN(10) TYPE C,
KOINH(30) TYPE C,
LIFNR(10) TYPE C,
END OF IT_BANK.
DATA : IT_BDCDATA LIKE BDCDATA OCCURS 0 WITH HEADER LINE,
IT_BDCMSGCOLL LIKE BDCMSGCOLL OCCURS 0 WITH HEADER LINE.
CALL FUNCTION 'WS_UPLOAD'
EXPORTING
FILENAME = 'C:\VENDOR.TXT'
FILETYPE = 'ASC'
TABLES
DATA_TAB = IT_DUMMY.
LOOP AT IT_DUMMY.
IF IT_DUMMY-DUMMY+0(2) = '11'.
IT_XK01-LIFNR = IT_DUMMY-DUMMY+2(10).
IT_XK01-BUKRS = IT_DUMMY-DUMMY+12(4).
IT_XK01-EKORG = IT_DUMMY-DUMMY+16(4).
IT_XK01-KTOKK = IT_DUMMY-DUMMY+20(4).
IT_XK01-NAME1 = IT_DUMMY-DUMMY+24(30).
IT_XK01-SORTL = IT_DUMMY-DUMMY+54(10).
IT_XK01-LAND1 = IT_DUMMY-DUMMY+64(3).
IT_XK01-SPRAS = IT_DUMMY-DUMMY+67(2).
IT_XK01-AKONT = IT_DUMMY-DUMMY+69(6).
IT_XK01-FDGRV = IT_DUMMY-DUMMY+75(2).
IT_XK01-WAERS = IT_DUMMY-DUMMY+77(3).
APPEND IT_XK01.
ELSE.
IT_BANK-BANKS = IT_DUMMY-DUMMY+2(3).
IT_BANK-BANKL = IT_DUMMY-DUMMY+5(10).
IT_BANK-BANKN = IT_DUMMY-DUMMY+15(10).
IT_BANK-KOINH = IT_DUMMY-DUMMY+25(30).
IT_BANK-LIFNR = IT_DUMMY-DUMMY+55(10).
APPEND IT_BANK.
ENDIF.
ENDLOOP.
LOOP AT IT_XK01.
REFRESH IT_BDCDATA.
perform bdc_dynpro using 'SAPMF02K' '0100'.
perform bdc_field using 'BDC_CURSOR'
'RF02K-REF_LIFNR'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'RF02K-LIFNR'
IT_XK01-LIFNR.
perform bdc_field using 'RF02K-BUKRS'
IT_XK01-BUKRS.
perform bdc_field using 'RF02K-EKORG'
IT_XK01-EKORG.
perform bdc_field using 'RF02K-KTOKK'
IT_XK01-KTOKK.
perform bdc_dynpro using 'SAPMF02K' '0110'.
perform bdc_field using 'BDC_CURSOR'
'LFA1-TELX1'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'LFA1-NAME1'
IT_XK01-NAME1.
perform bdc_field using 'LFA1-SORTL'
IT_XK01-SORTL.
perform bdc_field using 'LFA1-LAND1'
IT_XK01-LAND1.
perform bdc_field using 'LFA1-SPRAS'
IT_XK01-SPRAS.
perform bdc_dynpro using 'SAPMF02K' '0120'.
perform bdc_field using 'BDC_CURSOR'
'LFA1-KUNNR'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_dynpro using 'SAPMF02K' '0130'.
perform bdc_field using 'BDC_CURSOR'
'LFBK-KOINH(02)'.
perform bdc_field using 'BDC_OKCODE'
'=ENTR'.
DATA : FNAM(20) TYPE C,
IDX TYPE C.
MOVE 1 TO IDX.
LOOP AT IT_BANK WHERE LIFNR = IT_XK01-LIFNR.
CONCATENATE 'LFBK-BANKS(' IDX ')' INTO FNAM.
perform bdc_field using FNAM
IT_BANK-BANKS.
CONCATENATE 'LFBK-BANKL(' IDX ')' INTO FNAM.
perform bdc_field using FNAM
IT_BANK-BANKL.
CONCATENATE 'LFBK-BANKN(' IDX ')' INTO FNAM.
perform bdc_field using FNAM
IT_BANK-BANKN.
CONCATENATE 'LFBK-KOINH(' IDX ')' INTO FNAM.
perform bdc_field using FNAM
IT_BANK-KOINH.
IDX = IDX + 1.
ENDLOOP.
perform bdc_dynpro using 'SAPMF02K' '0130'.
perform bdc_field using 'BDC_CURSOR'
'LFBK-BANKS(01)'.
perform bdc_field using 'BDC_OKCODE'
'=ENTR'.
perform bdc_dynpro using 'SAPMF02K' '0210'.
perform bdc_field using 'BDC_CURSOR'
'LFB1-FDGRV'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'LFB1-AKONT'
IT_XK01-AKONT.
perform bdc_field using 'LFB1-FDGRV'
IT_XK01-FDGRV.
perform bdc_dynpro using 'SAPMF02K' '0215'.
perform bdc_field using 'BDC_CURSOR'
'LFB1-ZTERM'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_dynpro using 'SAPMF02K' '0220'.
perform bdc_field using 'BDC_CURSOR'
'LFB5-MAHNA'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_dynpro using 'SAPMF02K' '0310'.
perform bdc_field using 'BDC_CURSOR'
'LFM1-WAERS'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'LFM1-WAERS'
IT_XK01-WAERS.
perform bdc_dynpro using 'SAPMF02K' '0320'.
perform bdc_field using 'BDC_CURSOR'
'WYT3-PARVW(01)'.
perform bdc_field using 'BDC_OKCODE'
'=ENTR'.
perform bdc_dynpro using 'SAPLSPO1' '0300'.
perform bdc_field using 'BDC_OKCODE'
'=YES'.
CALL TRANSACTION 'XK01' USING IT_BDCDATA
MODE 'A'
UPDATE 'S'
MESSAGES INTO IT_BDCMSGCOLL.
ENDLOOP.
FORM BDC_DYNPRO USING PROG SCR.
CLEAR IT_BDCDATA.
IT_BDCDATA-PROGRAM = PROG.
IT_BDCDATA-DYNPRO = SCR.
IT_BDCDATA-DYNBEGIN = 'X'.
APPEND IT_BDCDATA.
ENDFORM.
FORM BDC_FIELD USING FNAM FVAL.
CLEAR IT_BDCDATA.
IT_BDCDATA-FNAM = FNAM.
IT_BDCDATA-FVAL = FVAL.
APPEND IT_BDCDATA.
ENDFORM.
Reward if helpful -
Default value for a column in Table Control
Hi friends, can i set dinamcally a default value for a column in table control?, this column is check type. This default value must appear in empty rows,
thanksADD A MODULE AS Module yyyy In ur PAI.
as
In PAI.
LOOP at itab.
Module YYYY
ENDLOOP.
Module YYYY.
LOOP AT SCREEN.
IF SCREEN-NAME = 'ITAB-VAL.
ITAB-VAL = 'XXXXXXXX' "(DEFAULT VALUE)
SCREEN-INPUT = 0.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
End module.
*note
make this event work only if the previous column is filled okay.
the display will be in display mode on the screen as screen-input = 0.
see that in the table control u can get the table field for all the rows even though you are processing on some fields .
so what u do is make that particular filed masked(no i/p field and populate the field that will be better instead of populating all the columns okay.
hope this helps you out ,
regards,
vijay. -
Search help for a field in table control based on another field value
Hi,
I want to attach the Search help for a field in table control based on another field value.
Please help me asap.
Will be highly rewardedHI,..
Check these links
search help in table control
Re: How to create Search Help for a field in Table control !!
How to create Search Help for a field in Table control !!
F4 Help In Table Control
Control table F4 help
Problem in F4 help in screen field
check this code
DATA: BEGIN OF it_value4 OCCURS 0,
TEXTCODE LIKE ZXX-TEXTCODE,
TEXTDESC LIKE ZXX-TEXTDESC,
END OF it_value4.
progname = sy-repid.
dynnum = sy-dynnr.
SELECT TEXTCODE TEXTDESC
FROM xxxx
INTO CORRESPONDING FIELDS OF TABLE<b> it_value4</b>
WHERE LOSS_CODE =<b> IT_VALUE1 .</b>
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'TEXTCODE'
dynpprog = progname
dynpnr = dynnum
dynprofield = 'ITVALUE-TEXTCODE' "-->UR 4 th filed value in screen
value_org = 'S'
TABLES
value_tab = it_value4.
endmodule.
Message was edited by:
veereshbabu ponnada -
How to provide F4 help for a field in table control
Hi Friends,
I have requirement like below.
1.Create one custom transaction code with header and item information.
2.In item level, we will be designed table control to enter/display the data.
3.Table controls first field will be material number and next DOT number (Material may have many DOT numbers) and so on.
4.First user will enter material number in the table controls first rows first field and go to DOT number field.
5.DOT number has drop down option. If user selects drop down box of DOT number, he gets all the DOT numbers available in database. User selects one DOT number and double clicks on it then it will be populated in DOT number field box.
But for point number 5, business wants like when ever user enters material number in table control first field then select DOT numbers drop down then they want to see the particular materials DOT numbers only in the drop down list for selection. Not all DOT numbers available in data base. Same thing should happen for all item lines in table control.
Please see below example.
Assume data base table has 10 DOT numbers. But material number has only 2 DOT numbers. When ever user enters material number in item level table control and selects DOT numbers drop down then it should show only 2 DOT numbers which are related to particular material number. Not all 10 DOT numbers.
Could you please suggest me, how can we achieve this?Hello,
Check this :-
For POV
Input Help in Dialog Modules
You can call dialog modules in the POV event using the event keyword PROCESS ON VALUE-REQUEST.
PROCESS ON VALUE-REQUEST.
FIELD <f> MODULE <mod>.
After the PROCESS ON VALUE-REQUEST statement, you can only use the MODULE statement together with the FIELD statement. When the user chooses F4 for a field <f>, the system calls the module <mod> belonging to the FIELD <f> statement. If there is more than one FIELD statement for the same field <f>, only the first is executed. The module <mod> is defined in the ABAP program like a normal PAI module. However, the contents of the screen field <f> are not available, since it is not transported by the FIELD statement during the PROCESS ON HELP-REQUEST event. You can now program your own value lists in the module. However, this procedure is only recommended if it really is not possible to use a search help. Defining search helps is much easier than PROCESS ON VALUE-REQUEST, since the system takes over some of the standard operations, such as getting field contents from the screen. It also ensures that the F4 help has a uniform look and feel throughout the system. Furthermore, it means that you do not have to reassign input help to fields on each screen.
Despite the introduction of search helps (and search help exits), there are still cases in which you need to use parts of the standard F4 functions directly. In this case, there are some standard function modules that you can use in the POV event. They support search helps, as well as all other kinds of input help, and are responsible for data transport between the screen and the input help. These all have the prefix F4IF_. The most important are:
F4IF_FIELD_VALUE_REQUEST
Calls the input help of the ABAP Dictionary dynamically. You can pass the component names of a structure or database table of the ABAP Dictionary to the function module in the import parameters TABNAME and FIELDNAME. The function module starts the ABAP Dictionary input help for this component. All of the relevant screen fields are read. If you specify the import parameters DYNPPROG, DYNPNR, and DYNPROFIELD, the users selection is returned to the corresponding field on the screen. If you specify the table parameter RETURN_TAB, the selection is returned into the table instead.
F4IF_INT_TABLE_VALUE_REQUEST
This function module displays a value list that you created in an ABAP program. The value list is passed to the function module as the table parameter VALUE_TAB. If you specify the import parameters DYNPPROG, DYNPNR, and DYNPROFIELD, the users selection is returned to the corresponding field on the screen. If you specify the table parameter RETURN_TAB, the selection is returned into the table instead.
There are also two function modules - DYNP_VALUES_READ and DYNP_VALUES_UPDATE - that can read the values of screen fields and return values to them during the POV event. For further information, refer to the relevant function module documentation.
Input help in dialog modules
REPORT DEMO_DYNPRO_F4_HELP_MODULE.
TYPES: BEGIN OF VALUES,
CARRID TYPE SPFLI-CARRID,
CONNID TYPE SPFLI-CONNID,
END OF VALUES.
DATA: CARRIER(3) TYPE C,
CONNECTION(4) TYPE C.
DATA: PROGNAME LIKE SY-REPID,
DYNNUM LIKE SY-DYNNR,
DYNPRO_VALUES TYPE TABLE OF DYNPREAD,
FIELD_VALUE LIKE LINE OF DYNPRO_VALUES,
VALUES_TAB TYPE TABLE OF VALUES.
CALL SCREEN 100.
MODULE INIT OUTPUT.
PROGNAME = SY-REPID.
DYNNUM = SY-DYNNR.
CLEAR: FIELD_VALUE, DYNPRO_VALUES.
FIELD_VALUE-FIELDNAME = 'CARRIER'.
APPEND FIELD_VALUE TO DYNPRO_VALUES.
ENDMODULE.
MODULE CANCEL INPUT.
LEAVE PROGRAM.
ENDMODULE.
MODULE VALUE_CARRIER INPUT.
CALL FUNCTION 'F4IF_FIELD_VALUE_REQUEST'
EXPORTING
TABNAME = 'DEMOF4HELP'
FIELDNAME = 'CARRIER1'
DYNPPROG = PROGNAME
DYNPNR = DYNNUM
DYNPROFIELD = 'CARRIER'.
ENDMODULE.
MODULE VALUE_CONNECTION INPUT.
CALL FUNCTION 'DYNP_VALUES_READ'
EXPORTING
DYNAME = PROGNAME
DYNUMB = DYNNUM
TRANSLATE_TO_UPPER = 'X'
TABLES
DYNPFIELDS = DYNPRO_VALUES.
READ TABLE DYNPRO_VALUES INDEX 1 INTO FIELD_VALUE.
SELECT CARRID CONNID
FROM SPFLI
INTO CORRESPONDING FIELDS OF TABLE VALUES_TAB
WHERE CARRID = FIELD_VALUE-FIELDVALUE.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
RETFIELD = 'CONNID'
DYNPPROG = PROGNAME
DYNPNR = DYNNUM
DYNPROFIELD = 'CONNECTION'
VALUE_ORG = 'S'
TABLES
VALUE_TAB = VALUES_TAB.
ENDMODULE.
The next screen (statically defined) for screen 100 is itself. It has the following layout:
The input fields have been adopted from the program fields CARRIER and CONNECTION. The pushbutton has the function code CANCEL with function type E.
The screen flow logic is as follows:
PROCESS BEFORE OUTPUT.
MODULE INIT.
PROCESS AFTER INPUT.
MODULE CANCEL AT EXIT-COMMAND.
PROCESS ON VALUE-REQUEST.
FIELD CARRIER MODULE VALUE_CARRIER.
FIELD CONNECTION MODULE VALUE_CONNECTION.
When the user chooses input help for the individual fields, the following is displayed:
For the Airline field, the POV module VALUE_CARRIER is called. The function module F4IF_FIELD_VALUE_REQUEST displays the input help for the component CARRIER1 of the structure DEMOF4HELP from the ABAP Dictionary, namely the search help DEMOF4DE. The users selection is returned to the screen field CARRIER.
For the Flight number field, the POV module VALUE_CONNECTION is called. The function module DYNP_VALUE_READ transports the value of the screen field CARRIER into the program. The program then reads the corresponding values from the database table SPFLI into the internal table VALUES_TAB using a SELECT statement, and passes the internal table to F4IF_INT_TABLE_VALUE_REQUEST. This displays the internal table as input help, and places the users selection into the screen field CONNECTION.
For POH------------
Field Help
There are three ways of displaying field help for screen elements:
Data Element Documentation
If you place a field on the screen in the Screen Painter by copying a ABAP Dictionary field, the corresponding data element documentation from the ABAP Dictionary is automatically displayed when the user chooses field help (as long as the help has not been overridden in the screen flow logic).
For further information about creating data element documentation, refer to data elements.
Data Element Supplement Documentation
If the data element documentation is insufficient, you can expand it by writing a data element supplement
Data element supplement documentation contains the heading Definition, as well as the following others:
Use
Procedure
Examples
Dependencies
To create data element supplement documentation for a screen, choose Goto ® Documentation ® DE supplement doc. from the element list of the screen. A dialog box appears in which the system proposes a number as the identified for the data element supplement. You can then enter help texts for the above headings using the SAPscript editor.
Data element supplement documentation created in this way is program- and screen-specific. Any data element supplement documentation created in the ABAP Dictionary with the same number is overridden by the screen-specific documentation. You can link existing data element supplement documentation created in the ABAP Dictionary with a screen field by using the table THLPF. To do this, crate a new row in THLPF containing the following data: Program name, screen name, field name, and number of the data element supplement documentation.
To display data element supplement documentation, you must code the following screen flow logic in the POH event:
PROCESS ON HELP-REQUEST.
FIELD <f> [MODULE <mod>] WITH <num>.
After PROCESS ON HELP-REQUEST, you can only use FIELD statements. If there is no PROCESS ON HELP-REQUEST keyword in the flow logic of the screen, the data element documentation for the current field, or no help at all is displayed when the user chooses F1. Otherwise, the next FIELD statement containing the current field <f> is executed.
If there is screen-specific data element supplement documentation for the field <f>, you can display it by specifying its number <num>. The number <num> can be a literal or a variable. The variable must be declared and filled in the corresponding ABAP program.
You can fill the variables, for example, by calling the module <mod> before the help is displayed. However, the FIELD statement does not transport the contents of the screen field <f> to the ABAP program in the PROCESS ON HELP-REQUEST event.
For further information about data element supplement documentation, refer to Data Element Supplements.
Calling Help Texts from Dialog Modules
If data element supplement documentation is insufficient for your requirements, or you want to display help for program fields that you have not copied from the ABAP Dictionary, you can call dialog modules in the POH event:
PROCESS ON HELP-REQUEST.
FIELD <f> MODULE <mod>.
After the PROCESS ON HELP-REQUEST statement, you can only use the MODULE statement together with the FIELD statement. When the user chooses F1 for a field <f>, the system calls the module <mod> belonging to the FIELD <f> statement. If there is more than one FIELD statement for the same field <f>, only the first is executed. However, the contents of the screen field <f> are not available in the module <mod>, since it is not transported by the FIELD statement during the PROCESS ON HELP-REQUEST event. The field help should not be dependent on the user input.
The module <mod> is defined in the ABAP program like a normal PAI module. The processing logic of the module must ensure that adequate help is displayed for the field in question. Instead of calling an extra screen with text fields, you should use one of the following function modules to display a suitable SAPscript document:
HELP_OBJECT_SHOW_FOR_FIELD
This function module displays the data element documentation for components of any structure or database table from the ABAP Dictionary. You pass the name of the component and structure or table to the import parameters FIELD and TABLE.
HELP_OBJECT_SHOW
Use this function module to display any SAPscript document. You must pass the document class (for example, TX for general texts, DE for data element documentation) and the name of the document to the import parameters DOKCLASS and DOKNAME. For technical reasons, you must also pass an empty internal table with the line type TLINE to the tables parameter of the function module.
For further information about how to create SAPscript documents, refer to the Documentation of System Objects documentation.
Field help on screens.
REPORT DEMO_DYNPRO_F1_HELP.
DATA: TEXT(30),
VAR(4),
INT TYPE I,
LINKS TYPE TABLE OF TLINE,
FIELD3, FIELD4.
TABLES DEMOF1HELP.
TEXT = TEXT-001.
CALL SCREEN 100.
MODULE CANCEL INPUT.
LEAVE PROGRAM.
ENDMODULE.
MODULE F1_HELP_FIELD2 INPUT.
INT = INT + 1.
CASE INT.
WHEN 1.
VAR = '0100'.
WHEN 2.
VAR = '0200'.
INT = 0.
ENDCASE.
ENDMODULE.
MODULE F1_HELP_FIELD3 INPUT.
CALL FUNCTION 'HELP_OBJECT_SHOW_FOR_FIELD'
EXPORTING
DOKLANGU = SY-LANGU
DOKTITLE = TEXT-002
CALLED_FOR_TAB = 'DEMOF1HELP'
CALLED_FOR_FIELD = 'FIELD1'.
ENDMODULE.
MODULE F1_HELP_FIELD4 INPUT.
CALL FUNCTION 'HELP_OBJECT_SHOW'
EXPORTING
DOKCLASS = 'TX'
DOKLANGU = SY-LANGU
DOKNAME = 'DEMO_FOR_F1_HELP'
DOKTITLE = TEXT-003
TABLES
LINKS = LINKS.
ENDMODULE.
The next screen (statically defined) for screen 100 is 100. It has the following layout:
The screen fields DEMOf1HELP-FIELD1 and DEMOF1HELP-FIELD2 from the ABAP Dictionary and the program fields FIELD3 and FIELD4 are assigned to the input fields. The pushbutton has the function code CANCEL with function type E.
The screen flow logic is as follows:
PROCESS BEFORE OUTPUT.
PROCESS AFTER INPUT.
MODULE CANCEL AT EXIT-COMMAND.
PROCESS ON HELP-REQUEST.
FIELD DEMOF1HELP-FIELD2 MODULE F1_HELP_FIELD2 WITH VAR.
FIELD FIELD3 MODULE F1_HELP_FIELD3.
FIELD FIELD4 MODULE F1_HELP_FIELD4.
The components FIELD1 and FIELD2 of structure DEMOF1HELP both refer to the data element DEMOF1TYPE. This data element is documented, and also has two supplements with numbers 0100 and 0200.
The following field help is displayed:
When the user chooses F1 on the input field for DEMOF1HELP-FIELD1, the data element documentation for DEMOF1TYPE is displayed, since the field does not occur in the PROCESS ON HELP-REQUEST event.
If the user chooses F1 repeatedly for the input field DEMOF1HELP-FIELD2, the data element documentation is displayed, along with the supplement documentation for either 0100 or 0200 alternately. The variable VAR is filled in the dialog module F1_HELP_FIELD2.
When the user chooses F1 on the input field for FIELD3, the data element documentation for DEMOF1TYPE is displayed, since this is called in the dialog module F1_HELP_FIELD3 by the function module HELP_OBJECT_SHOW_FOR_FIELD.
When the user chooses F1 on the input field for FIELD4, the SAPscript documentation DEMO_FOR_F1_HELP is displayed, since this is called in the dialog module F1_HELP_FIELD4 by the function module HELP_OBJECT.
Regards,
Deepu.K -
Possible to code a Find/Find Next feature for use inside a Table Control
Hello,
I have a Table Control that displays many lines. Is it possible to code a Find/Find Next feature that would allow the user to enter a 'keyword' then search each line of the Table Control for existing matches?
I have provided the user with various Selection Criteria that will filter the table control results, but there are still too many lines to visually scan for the desired result.
I am guessing that I would place an input box and a 'Find' button onto my layout screen. Then in user command, I have to scroll through each line of the table control and check every value to see if the string contains 'keyword' When found, stop and display table control assigning current line as Top line?
Am I on the right track or is there a better solution already?
Kind Regards,
MPerssonI've done that. It works pretty well. You might want to allow the user to search only in selected column(s) as well.
Rob -
Sample pgm for moving data from table control to internal table
Hi Experts,
I am newbi to ABAP. I don't have good material for Table control . Appreciate if you direct me to some good source of knowledge on Table control.
The problem at hand : I am trying to move info/data from table control (in screen painter/ input and output mode ) to ITAB but couldn't . Sample pgm if possible.
<b>Modify ITAB index TC-Current_Line .</b>
The above statement is not inserting new lines to ITAB . Help me!
Thanks for your timehi,
do like this...
<b>PROCESS AFTER INPUT.</b>
*&SPWIZARD: PAI FLOW LOGIC FOR TABLECONTROL 'TAB1'
LOOP AT itab_det.
CHAIN.
FIELD itab_det-comp_code.
FIELD itab_det-bill_no.
FIELD itab_det-bill_date.
FIELD itab_det-vend_cust_code.
FIELD itab_det-bill_amt.
MODULE <b>tab1_modify</b> ON CHAIN-REQUEST.
ENDCHAIN.
FIELD itab_det-mark
MODULE tab1_mark ON REQUEST.
ENDLOOP.
<b>MODULE tab1_modify INPUT.</b>
APPEND itab_det.
<b>ENDMODULE. "TAB1_MODIFY INPUT</b> -
The PAI Event Code to search for a record in Table Control
Logic
1. I have a position button and entry text field (search content) for a table control in my screen. Position button has the function code 'PBUT'.
2. Content of table control will be in an internal table. The entry text field is to be used for positioning.
3. I enter the search (key) field in text field & Click the position button.
4. The PAI event of button click (Module user_command) of that screen is as under.
Case sy_ucomm.
When 'PBUT'.
What will be the code to bring the row as selected in table control, that I have to write here, for this case-value.
Endcase.
Regards,Hi Alok,
Excuse me, couldn`t catch u yesterday. Ok i`ve the code which will set the cursor on the selected entry.
Reward points if convinced.
*& Report Y131_TC_TEST *
REPORT y131_tc_test NO STANDARD PAGE HEADING.
TABLES: vbak.
DATA : BEGIN OF str_tc,
vbeln LIKE vbak-vbeln,
erdat LIKE vbak-erdat,
END OF str_tc,
it_tc LIKE TABLE OF str_tc WITH HEADER LINE,
loopc LIKE sy-loopc,
flag,
lin TYPE i.
CONTROLS : my_tc TYPE TABLEVIEW USING SCREEN 9000.
CALL SCREEN 9000.
*& Module STATUS_9000 OUTPUT
* text
MODULE status_9000 OUTPUT.
* SET PF-STATUS 'xxxxxxxx'.
* SET TITLEBAR 'xxx'.
IF it_tc[] IS INITIAL.
SELECT vbeln erdat INTO TABLE it_tc UP TO 10
ROWS FROM vbak.
DESCRIBE TABLE it_tc LINES lin.
my_tc-top_line = loopc.
ENDIF.
ENDMODULE. " STATUS_9000 OUTPUT
*& Module USER_COMMAND_9000 INPUT
* text
MODULE user_command_9000 INPUT.
CASE sy-ucomm.
WHEN 'EXIT'.
LEAVE PROGRAM.
<b> WHEN 'PBUT'.</b>
**** Now this event is triggerred when the user uses the ****Position Push button to locate the field value.
CALL SCREEN 9001 STARTING AT 10 15.
ENDCASE.
ENDMODULE. " USER_COMMAND_9000 INPUT
*& Module USER_COMMAND_9001 INPUT
* text
MODULE user_command_9001 INPUT.
CASE sy-ucomm.
WHEN 'OKAY' OR ' ' or 'EXIT'.
<b>**** When the user selects values from the search help on **** position button, the itab is read and index is *****assigned</b>
READ TABLE it_tc WITH KEY vbeln = vbak-vbeln.
IF sy-subrc = 0.
loopc = sy-tabix.
flag = 'X'.
**** the cursor is set here
<b> my_tc-top_line = loopc.</b>
SET SCREEN 0.
LEAVE SCREEN.
ENDIF.
ENDCASE.
ENDMODULE. " USER_COMMAND_9001 INPUT
*& Module STATUS_9001 OUTPUT
* text
MODULE status_9001 OUTPUT.
SET PF-STATUS 'MODAL'.
* SET TITLEBAR 'xxx'.
ENDMODULE. " STATUS_9001 OUTPUT
Regards -
Search help for material number in table control
Hi
I have a table which i have generated using table control wizard.
I have used an interal table while creating the table control through wizard.
In this internal table i have field matnr.Now my requirement is to have a search help for this field.
I want a default search help for material as you get one instandard transactions.
In my other i have ip/op field i.e matnr and i have used the field directly from ztable,it has got the search help but since i am using the internal table i am notting getting a search help .
can anyone tell how to assign a search help to my table control material fieldhi deepthi,
chk a sample one which will help u. <b><i>f4 hlp in table control</i></b>
* Screen flow logic........
PROCESS BEFORE OUTPUT.
*MODULE PBO_MODULE.
PROCESS AFTER INPUT.
*MODULE PAI_MODULE.
PROCESS ON VALUE-REQUEST. "F4
FIELD EKPO-EBELP MODULE help_ekpo.
* populate screen field from within PROCESS ON VALUE-REQUEST(F4) call
*& Module help_responsibility INPUT
* text
MODULE help_ekpo INPUT.
**Transport values to table dynpro/screen table control
DATA: l_stepl LIKE sy-stepl,
l_indx LIKE sy-stepl.
DATA: dynpfields LIKE dynpread OCCURS 5 WITH HEADER LINE.
* Adjust for scroling within table control
CALL FUNCTION 'DYNP_GET_STEPL'
IMPORTING
povstepl = l_stepl
EXCEPTIONS
stepl_not_found = 0
OTHERS = 0.
l_indx = tc_ekpotable-top_line + l_stepl - 1.
"tc_ekpotable should already have been declared
REFRESH dynpfields.
CLEAR dynpfields.
dynpfields-fieldname = 'EKPO-EBELN'.
dynpfields-fieldvalue = '00010' "wa_ekpo-ebeln.
dynpfields-stepl = l_stepl.
APPEND dynpfields.
dynpfields-fieldname = 'EKPO-EBELP'.
dynpfields-fieldvalue = '00020' "wa_ekpo-ebelp.
dynpfields-stepl = l_stepl.
APPEND dynpfields.
CALL FUNCTION 'DYNP_VALUES_UPDATE'
EXPORTING
dyname = 'SAPLZZ_EKKO' "Program name
dynumb = '0100' "Screen number
TABLES
dynpfields = dynpfields
EXCEPTIONS
OTHERS = 0.
ENDMODULE. " help_ekpo INPUT
rgds
Anver
<b><i>if hlped kindly mark points</i></b> -
Issue with input field in table control
Hi,
I have an issue with field acgl_item-rstgr in the table control.
I have created a screen program with a table control.
In the control i have added a dictionary field as acgl_item-rstgr.
When i execute, do f4 on the input field, select a value and press enter, then it is showing me
error as 'Entry 'val' does not exist in T053R (check entry). Its really weird to understand this. I have selected the value
from f4 and even then it says this. Its working for all other columns, but not working only for RSTGR.
Plz help me on this regard.
Code is like this.
TYPES : BEGIN OF ty_rstgr,
rstgr TYPE RSTGR,
END OF ty_rstgr.
TABLES : ACGL_ITEM.
DATA : it_rstgr TYPE TABLE OF ty_rstgr.
DATA : wa_rstgr TYPE ty_rstgr.
CONTROLS : table TYPE TABLEVIEW USING SCREEN 100.
PROCESS BEFORE OUTPUT.
MODULE STATUS_0100.
LOOP AT it_rstgr INTO wa_rstgr WITH CONTROL TABLE.
ENDLOOP.
PROCESS AFTER INPUT.
MODULE USER_COMMAND_0100.
LOOP AT it_rstgr.
ENDLOOP.
Thanks,Hi Navitha,
Its Check Table concepts for the error u stated. Please check wht the Search help ur using...Because for this field there is no search help at value table level...Use search help that hold all master data or create a custom search field in SE11 level or in program level.
Cheers,
Naveen -
Setting column to input enabled in table control at run time
Hi friends,
I have one table control in that all columns are
set as display only field or ( output only).
Now, when I press enter key one column should be
enabled as input field. HOW TO DO THAT?
my coading.
loop at ztblctrl-cols into s_cols.
if s_cols-screen-name = 'ZGATEPASS-MENGE'.
s_cols-screen-input = 1.
s_cols-screen-output = 1.
s_cols-screen-invisible = 0.
s_cols-screen-active = 1.
s_cols-screen-required = 1.
move s_screen to s_cols-screen.
modify ztblctrl-cols from s_cols.
endif.
endloop.
Regards,
s.senthil kumarHi Kumar,
Hope your code is in PBO.
See the below 2 links and you will come to know where you are going wrong.
http://help.sap.com/saphelp_nw04/helpdata/en/9f/dbac5e35c111d1829f0000e829fbfe/content.htm
http://sap.niraj.tripod.com/id29.html
Reward points for helpful answers.
Regards,
hari -
Method for dble-click and table control
I'm a beginner in object. I build, with screen painter, a table control with x rows and x cols. and give the possibilty to use 'double click'.
But how to handle this event by a method and importing the number of the row and col where the action of the event has been.
which class and method can i use. thanks for your help
Moderator message: sorry, these forums are not a replacement for ABAP training, please search for available information and documentation, there is plenty available.
Edited by: Thomas Zloch on Dec 7, 2010 4:21 PMhi,
You can do this by estimating maximum no of records of that internal table used for table control to some number and then assign that number lines field of table control.
try this.
Regds
Sivaparvathi
Please reward points if helpful... -
A table control is created in screen painter and an internal table was used to store particular data in ABAP program.
Information were entered into the table through ABAP program(insert value into internal table). The input check generated by data dictionary do not work due to data not inserted from screen field. How can I solved the problem?
Do I need to manually program the input check using module as following:
FIELD f Module m.
But how can I make the whole row ready for input and with cursor on particular column just like what was done with normal data dictionary input check?
Message class 00 number 058 with text
Entry & & & does not exist in &4 - check your entry
can be used for compute the message.What are those conditions that will trigger the input check for my situation?
I can only do that for those fields with check table.
Here are what I had done:
<b>Flow Logic</b>
field EBAN-EKGRP MODULE CHECK_EKGRP. " Purchasing Group
<b>Module code</b>
MODULE CHECK_EKGRP INPUT.
TABLES: T024.
CHECK: EBAN-EKGRP IS NOT INITIAL.
SELECT SINGLE * FROM T024 WHERE EKGRP = EBAN-EKGRP.
IF SY-SUBRC NE 0.
MESSAGE E058(00) WITH EBAN-EKGRP '' '' 'T024'.
ENDIF.
ENDMODULE. " CHECK_EKGRP INPUT
However, this is not applicable for those without check table.
Please help. Points will be awarded for helpful answers.
Maybe you are looking for
-
HT4623 i need ios 7 in my iphone
hi i need ios 7 in my iphone
-
I just bought my iPhone yesterday, and I noticed there there is a spec of dust about 1-2 pixels big underneath the glass surface of my screen. It's right in the middle of it, so it is pretty obvious to see. I know that it is dust, and not simply a de
-
Phone 5 to use here in the States with an AT
Hi, I unlocked my iPhone 5 to use here in the States. (From the UK) I restored via iTunes. Have an AT&T SIM. Could make and receive a call, but now can no longer. Still connected to AT&T but cannot make or receive calls. Please can anyone help or adv
-
i could not connect to itunes store via itunes. I have my internet connected, fire wall disabled . please help
-
Hi we run 2012 enterprise and to be proactive i thought i'd ask the community what the len function will return on our nvarchar(30) col when our foreign partners start populating with chars that really need to occupy 2 bytes per visible char. I alre