Dynamically assign fields to table control
Hi All,
I have some requirements with me... I have a report which has an output table. The output table will be filled based on some conditions.
ex... 1) select name, id, date
2) select name, id, time (just an ex)
My output table contains name, id, date, time.
So, I would like to dynamically display the fields on to the table control to either display 1) or 2).
Is it doable thru Visual Composer?
Please suggest.....
Regards,
Manjunatha.T.S
When you use a JDBC system, the fields may change at runtime.
So, generally, any fields that come out of the stored procedure at runtime will be displayed in the table.
Lior
Similar Messages
-
How to do the calculations with currency fields in table control?
Hi everybody,
Can anyone tell me how to do the calculations (arithmetical) with the currency fields which have been assigned for a table control fields? Actually they should be fetched from the database table and need to do some calculations and after that the same should get updated at the database level.
Here, i am getting the short dump after doing the calculations and trying to display at the table control field itself.....
Can anyone help me in this issue........
Thank you very much.....in advance,
Somu.Hi,
Thanks to your replies all,
But, even though the sign check box is checked in the SAP domain WRTV7, in my program it is not showing the negative sign at all...
I am keep trying for all the options...
But still it is not working out...
My requirement is after fetching the data from the database i need to do calculations and save back same to the customized table field, for which the domain i have checked the sign and have done it also...
I'd be highly thankful to you, if you can help me out...
Thank you,
Somu. -
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. -
Export all data of selected line in search help to fields in table control
I've created a search help which will export 4 fields. These 4 fields should be populated to the corresponding fields in TABLE CONTROL. However, in my program, only the first column is populated and the others are blank. How to solve this problem? Do I need to include POV? Thank you.
Hi,
1. Create a search help with four exporting parameters.
( check the you have created properly the sterp step
procedure in creating the search help).
2. No need to go for POV.
3. After creating the table control assign the fieldnames into
the control, then click on the fieldname it will show the
attributes of that field . ther you can find te search help field
fill that field with your search help name .
4.After assigning the field, check it in executing the report.
Hope this will work for you, if it is not let me know.
Reward points if it is helpful .
Regards,
Madhavi -
How to add a field and table control to BP transaction.
Hi,
I have a requirement to add a field and table control to the 'Control data' tab of the Transaction BP.
Can some on please help me if having a solution and with any relavant documents.
Thanks in advance.
Raj & Khader.Also explore with EEWB tcode.
Refer this threads
Re: EEWB
Created New fields in Business Activity with EEWB
Cheers
Manohar -
To Disble the Field in Table Control after clicking Save button
Hi,
I have a requirement as follows. i need to disable one field in the table control after clicking save button. i tried with SCREEN elements but it disabling whole the table control but i need to disable that particular one record only in the table control. i found Structure CXTAB_COLUMN in documentaion. it has the properties like invisible. can any body tell how can we disble that particular field in table control only for the one record. and how can we use CXTAB_COLUMN.
Thanks in advance.hi,
do like this...
in USER_COMMAND_1000 module of PAI,
MODULE user_command_1000 INPUT.
CASE ok_code.
WHEN 'BACK' OR 'UP' OR 'CANC'.
LEAVE PROGRAM.
WHEN 'SAVE'.
fl = 1.
GET CURSOR LINE lin.
ENDCASE.
ENDMODULE. " user_command_1000 INPUT
and make on module disable in Loop Endloop in PBO.
and write like this...
MODULE disable OUTPUT.
LOOP AT SCREEN.
IF tab1-current_line = lin AND fl = 1.
screen-input = 0.
ELSEIF tab1-current_line < lin.
screen-input = 0.
ELSE.
screen-input = 1.
ENDIF.
MODIFY SCREEN.
ENDLOOP.
ENDMODULE. " disable OUTPUT
here fl and lin both are type i.....
and there will b one module in PBO
MODULE tab1_change_tc_attr.
in that put if condition....
MODULE tab1_change_tc_attr OUTPUT.
IF sy-ucomm <> '' AND sy-ucomm <> 'SAVE'.
DESCRIBE TABLE itab LINES tab1-lines.
ENDIF.
ENDMODULE. "TAB1_CHANGE_TC_ATTR OUTPUT
ur problem will solve...
reward if usefull....
Edited by: Dhwani shah on Jan 2, 2008 1:17 PM -
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 disable fields in Table control???
Hi
How to disable fields in Table control??? I want to disable particular row in table control when enter datas are correct.lets take as example ME41 or ME51 table control.
Can anyone tell how to do disable in this table control
Points will be rewarded if its helpful.
Thanks
senthilIf you want to disable the row then you can use
in pbo module create a module in side loop,
loop at itab with control tc.
module change_screen.
endloop.
in module,,,,,
loop at screen.
if condition.
screen-input = 0.
modify screen.
endif.
endloop.
Regards
Vijay -
Adding custom fields in table control of infotype 0591
Dear Experts,
My requirement is to add custom fields x y z in the Table contol of the standard infotype 0591 (Nominations) screen in PA30 tcode.
Is it possible to add the fields in table control after the fields share,guardian's address, without using access key.
if so, help me to know the procedure.
Please suggest.
Warm Regards
Sinde.hi..
a thread already exists with the same Subject.. pls check if it helps u.... -
Attaching search help to a field in table control
Hi,
Please suggest a way to attach search help functionality to a field in table control.
My requirement os based on matnr the f4 help for the next field shud come.
I gave the func mod dunp_values_read, but the internal table i pass does not return with the fieldvalue of matnr field.
is there any func mod to read values of screen fields in table control so that based on that I can go to func mod f4_init_....
Will be rewarded.Check the FM: HELP_VALUES_GET_WITH_TABLE_EXT
Check the documentation for example code.
regards,
Ravi -
Hi Folks,
I have a requirement of adding a field in Table control of Standard SAP transaction also updating the same in standard SAP database table.
The field is also not existing in the table, it is also added to the table using Append Structure.
Will this be possible using some Screen Exit?
Thanks in Advance.
PunitHi Poorna,
Thanks for the reply.
I have to add field to the txn QM02. User will specify the value for the custom field in this txn and the same should be updated in the database table.
The field is not a std SAP field, it is added to the table using append structure.
Thanks,
Punit -
Adding field to Table Control using screen exit
Hi Folks,
I have a requirement of adding a field in Table control of Standard SAP transaction also updating the same in standard SAP database table.
The field is also not existing in the table, it is also added to the table using Append Structure.
Will this be possible using some Screen Exit?
Thanks in Advance.
PunitHi Punit,
There are various screen user exits(QQMA0001,QQMA0008,QQMA0010,
QQMA0011,QQMA0012) available for this transaction but all are related to adding a subscreen.So, I am not very sure whether we can modify a table control for this transaction. So, If possible if u r requirement still can be acheived with creation of a subscreen then it would do only if the exits which were mentioned above belongs to u r main screen..
Regards,
Swaroop -
FILTER FOR A FIELD IN TABLE CONTROL?
DEAR GURUS,
I HAVE A REQUIREMENT WHERE IN I HAVE TO FILTER A FIELD IN TABLE CONTROL?
PLEASE HELP?
Moderator message - Please ask a specific question and do not use all caps - post locked
Edited by: Rob Burbank on May 4, 2009 4:27 PMDidn't get you.........Explain please......
-
To add a custom field in table control in transaction me21n and me22n
Hi Guru's,
I have a requirement to add a field in the table control at the time of creation of PO (ME21N). I enhansed the structure MEPO1211, but it is not appearing in the transaction. What should i do in order to bring that field in table control.
I implemented badis ME_GUI_PO_CUST and ME_PROCESS_PO_CUST by seeing some forum results.But i didnt get how to implement...
Please help me in this regard how to follow the steps and if possible please provide a sample code.
Thanks & Regards,
R.P.Sastryhi,
Suppose in the there are three tabs BADI customer1, BADI customer2 and BADI customer3 at item level.
Say:
On BADI customer1 there are three fields FIELD1, FIELD2 and FIELD3.
On BADI customer2 there are two fields FIELD4 and FIELD5.
On BADI customer3 there are three fields FIELD6, FIELD7 and FIELD8.
Then the fields have to be added to EKPO (or requisite custom table as the need may be) and also fields are also to be added to custom structures.
Create a Structure ZSTRUCTURE1 which will contain the three fields FIELD1, FIELD2 and FIELD3.
Create another Structure ZSTRUCTURE2 which will contain the two fields FIELD4 and FIELD5.
Create another Structure ZSTRUCTURE2 which will contain the three fields FIELD6, FIELD7 and FIELD8.
The Structure STRUCTURE1 has to be passed for tab BADI customer1, the Structure STRUCTURE2 has to be passed for tab BADI customer2 and the Structure STRUCTURE3 has to be passed for tab BADI customer3.
Each custom tab/screen should have its own structure to handle the screen fields, but the screen field data has to be transfered to and from EKPO (or requisite custom table as the need may be) for database update/retrieve.
Hope this helps.
Regards,
Ritesh -
Dynamicaly setting SCREEN-INPUT field in TABLE CONTROL
hai guys,
in my table control i have REFNUM field and some other fields.
now my task is,
in every row,i have to enable the REFNUM field of table control for editing only if REFNUM is blank.
else i shud disable it.(when REFNUM is filled).
all other fields should be always disabled.
(right now,i am just able to either totaly enable the entire REFNUM coloumn or or totaly disable it for editing,irrespective of the values it is holding.)
shravan ramidiis this not possible?
can some one confirm it..
Maybe you are looking for
-
I just purchased Adobe Photoshop Elements 12 and can not open it and it does not show up in my list of Programs
-
Error while trying to retrieve text ......
Hello, while connecting to Oracle 8i from my VB program i get the following error. -2147217843[Oracle][ODBC][Ora] Error while trying to retrieve text for error ORA-12154. but i get the connection in debug mode. please give any guidance. I am using Or
-
Hi All Folks, I have got a problem with ActionRequest. I used to use Liferay portal and now I am porting something to Oracel Portal. I use JDeveloper and write JSR 168 portlets. So there aren't too many things to change. In somewhere in my code, I pu
-
We recently began using PeopleSoft's VAT functionality in a few countries. However, we now have an issue where when we go to "-->Billing-->Maintain Bills-->Standard Billing", and when we click to "Add New Value", if we select one of the business unit
-
After installing windows xp accidentlly i erased macintosh hard disc. Now my macbook shows blank white screen with sign of folder with '?' blinking. Now what to do please help