Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Adding F4 help in a table control field

Former Member
0 Kudos

Hi,

I Have a table control with records, i want to add an F4 functionality in one field. When you press f4 i want to bring a pop up screen for that field...please help

7 REPLIES 7

Former Member
0 Kudos

Hai Pinky,

You can easily do this by creating a search help and giv it in the search help parameter

of the particular field u require or else u can write a POV for the field.

Regards,

Neeraj.

Clemenss
Active Contributor
0 Kudos

Hi Pinky,

if the field has F4 help anywhere, it will have in table control as well. Use domain fix values, check table or search help. If you don't know jhow to use those standardized elements, you can do it programatically using MODULE xyz ON VALUE-RQUEST.

Regards,

Clemens

Former Member
0 Kudos

hi ,

have a pai module for that field.

in the flow logic.

processs on value-request

field (ur table control field) module xyz.

then in the main program.

module xyz.

populate ur internal table with values u want to dispaly in popup.

and call this function module.

popup_with_table.

give choice as <ur table control field.>

endmodule.

Former Member
0 Kudos

Hi

Hope it will help you.

Reward if help.

Check the below link.

http://www.sap-img.com/abap/bdc-example-using-table-control-in-bdc.htm

THis is example to upload the Bank details of the Vendor which has the TC.

REPORT zprataptable2

NO STANDARD PAGE HEADING LINE-SIZE 255.

DATA : BEGIN OF itab OCCURS 0,

i1 TYPE i,

lifnr LIKE rf02k-lifnr,

bukrs LIKE rf02k-bukrs,

ekorg LIKE rf02k-ekorg,

ktokk LIKE rf02k-ktokk,

anred LIKE lfa1-anred,

name1 LIKE lfa1-name1,

sortl LIKE lfa1-sortl,

land1 LIKE lfa1-land1,

akont LIKE lfb1-akont,

fdgrv LIKE lfb1-fdgrv,

waers LIKE lfm1-waers,

END OF itab.

DATA : BEGIN OF jtab OCCURS 0,

j1 TYPE i,

banks LIKE lfbk-banks,

bankl LIKE lfbk-bankl,

bankn LIKE lfbk-bankn,

END OF jtab.

DATA : cnt(4) TYPE n.

DATA : fdt(20) TYPE c.

DATA : c TYPE i.

INCLUDE bdcrecx1.

START-OF-SELECTION.

CALL FUNCTION 'WS_UPLOAD'

EXPORTING

filename = 'C:\first1.txt'

filetype = 'DAT'

TABLES

data_tab = itab.

CALL FUNCTION 'WS_UPLOAD'

EXPORTING

filename = 'C:\second.txt'

filetype = 'DAT'

TABLES

data_tab = jtab.

LOOP AT itab.

PERFORM bdc_dynpro USING 'SAPMF02K' '0100'.

PERFORM bdc_field USING 'BDC_CURSOR'

'RF02K-KTOKK'.

PERFORM bdc_field USING 'BDC_OKCODE'

'/00'.

PERFORM bdc_field USING 'RF02K-LIFNR'

itab-lifnr.

PERFORM bdc_field USING 'RF02K-BUKRS'

itab-bukrs.

PERFORM bdc_field USING 'RF02K-EKORG'

itab-ekorg.

PERFORM bdc_field USING 'RF02K-KTOKK'

itab-ktokk.

PERFORM bdc_dynpro USING 'SAPMF02K' '0110'.

PERFORM bdc_field USING 'BDC_CURSOR'

'LFA1-LAND1'.

PERFORM bdc_field USING 'BDC_OKCODE'

'/00'.

PERFORM bdc_field USING 'LFA1-ANRED'

itab-anred.

PERFORM bdc_field USING 'LFA1-NAME1'

itab-name1.

PERFORM bdc_field USING 'LFA1-SORTL'

itab-sortl.

PERFORM bdc_field USING 'LFA1-LAND1'

itab-land1.

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-BANKN(01)'.

PERFORM bdc_field USING 'BDC_OKCODE'

'=ENTR'.

cnt = 0.

LOOP AT jtab WHERE j1 = itab-i1.

cnt = cnt + 1.

CONCATENATE 'LFBK-BANKS(' cnt ')' INTO fdt.

PERFORM bdc_field USING fdt jtab-banks.

CONCATENATE 'LFBK-BANKL(' cnt ')' INTO fdt.

PERFORM bdc_field USING fdt jtab-bankl.

CONCATENATE 'LFBK-BANKN(' cnt ')' INTO fdt.

PERFORM bdc_field USING fdt jtab-bankn.

IF cnt = 5.

cnt = 0.

PERFORM bdc_dynpro USING 'SAPMF02K' '0130'.

PERFORM bdc_field USING 'BDC_CURSOR'

'LFBK-BANKS(01)'.

PERFORM bdc_field USING 'BDC_OKCODE'

'=P+'.

PERFORM bdc_dynpro USING 'SAPMF02K' '0130'.

PERFORM bdc_field USING 'BDC_CURSOR'

'LFBK-BANKN(02)'.

PERFORM bdc_field USING 'BDC_OKCODE'

'=ENTR'.

ENDIF.

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'

itab-akont.

PERFORM bdc_field USING 'LFB1-FDGRV'

itab-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'

itab-waers.

PERFORM bdc_dynpro USING 'SAPMF02K' '0320'.

PERFORM bdc_field USING 'BDC_CURSOR'

'RF02K-LIFNR'.

PERFORM bdc_field USING 'BDC_OKCODE'

'=ENTR'.

PERFORM bdc_dynpro USING 'SAPLSPO1' '0300'.

PERFORM bdc_field USING 'BDC_OKCODE'

'=YES'.

PERFORM bdc_transaction USING 'XK01'.

ENDLOOP.

PERFORM close_group.

Header file:

1 63190 0001 0001 0001 mr bal188 b in 31000 a1 inr

2 63191 0001 0001 0001 mr bal189 b in 31000 a1 inr

TC file:

1 in sb 11000

1 in sb 12000

1 in sb 13000

1 in sb 14000

1 in sb 15000

1 in sb 16000

1 in sb 17000

1 in sb 18000

1 in sb 19000

1 in sb 20000

1 in sb 21000

1 in sb 22000

2 in sb 21000

2 in sb 22000

**********************************************

REPORT zmm_pr_upload_mat

NO STANDARD PAGE HEADING

LINE-SIZE 255.

  • Standard Include for Selection Screen

INCLUDE bdcrecx1.

  • Internal Table for Upload Data

DATA: BEGIN OF i_pr OCCURS 0,

  • Header Screen

sno(3), " SNo

bsart(004), " PR Type

epstp(001), " Item Category

knttp(001), " Account Assignment

eeind(010), " Delivery Date

  • lpein(001), " Category of Del Date

werks(004), " Plant

lgort(004), " Storage Location

ekgrp(003), " Purchasing Group

matkl(009), " Material Group

bednr(010), " Tracking No

afnam(012), " Requisitioner

  • Item Details

matnr(018), " Material No

menge(017), " Quantity

  • badat(010),

  • frgdt(010),

preis(014), " Valuation Price

  • waers(005), " Currency

  • peinh(005),

  • wepos(001),

  • repos(001),

sakto(010), " GL Account

kostl(010), " Cost Center

  • bnfpo(005),

END OF i_pr.

  • Internal Table for header Data

DATA: BEGIN OF it_header OCCURS 0,

sno(3), " SNo

bsart(004), " PR Type

epstp(001), " Item Category

knttp(001), " Account Assignment

eeind(010), " Delivery Date

werks(004), " Plant

lgort(004), " Storage Location

ekgrp(003), " Purchasing Group

matkl(009), " Material Group

bednr(010), " Tracking No

afnam(012), " Requisitioner

END OF it_header.

  • Internal Table for Item Data

DATA: BEGIN OF it_item OCCURS 0,

sno(3), " SNo

matnr(018), " Material No

menge(017), " Quantity

preis(014), " Valuation Price

sakto(010), " GL Account

kostl(010), " Cost Center

END OF it_item.

  • Data Variables & Constants

CONSTANTS : c_x VALUE 'X'. " Flag

DATA : v_l(2), " Counter

v_rowno(5), " Row No

v_2(2), " Counter

v_rows LIKE sy-srows, " Rows in TC

v_field(45). " String

  • Parameters

PARAMETERS: p_file LIKE ibipparms-path. " Filename

  • At selection-screen on Value Request for file Name

AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.

  • Get the F4 Values for the File

CALL FUNCTION 'F4_FILENAME'

EXPORTING

program_name = syst-cprog

dynpro_number = syst-dynnr

IMPORTING

file_name = p_file.

  • Start of Selection

START-OF-SELECTION.

  • Open the BDC Session

PERFORM open_group.

  • Upload the File into internal Table

CALL FUNCTION 'UPLOAD'

EXPORTING

filename = p_file

filetype = 'DAT'

TABLES

data_tab = i_pr

EXCEPTIONS

conversion_error = 1

invalid_table_width = 2

invalid_type = 3

no_batch = 4

unknown_error = 5

gui_refuse_filetransfer = 6

OTHERS = 7.

IF sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

SORT i_pr BY sno.

LOOP AT i_pr.

MOVE-CORRESPONDING i_pr TO it_item.

APPEND it_item.

CLEAR it_item.

AT END OF sno.

READ TABLE i_pr INDEX sy-tabix.

MOVE-CORRESPONDING i_pr TO it_header.

APPEND it_header.

CLEAR it_header.

ENDAT.

ENDLOOP.

SORT it_header BY sno.

SORT it_item BY sno.

v_rows = sy-srows - 6.

  • Upload the Data from Internal Table

LOOP AT it_header.

  • Header Data

PERFORM bdc_dynpro USING 'SAPMM06B' '0100'.

PERFORM bdc_field USING 'BDC_CURSOR'

'EBAN-BEDNR'.

PERFORM bdc_field USING 'BDC_OKCODE'

'/00'.

PERFORM bdc_field USING 'EBAN-BSART'

it_header-bsart.

PERFORM bdc_field USING 'RM06B-EPSTP'

it_header-epstp.

PERFORM bdc_field USING 'EBAN-KNTTP'

it_header-knttp.

PERFORM bdc_field USING 'RM06B-EEIND'

it_header-eeind.

  • PERFORM bdc_field USING 'RM06B-LPEIN'

  • it_header-lpein.

PERFORM bdc_field USING 'EBAN-WERKS'

it_header-werks.

PERFORM bdc_field USING 'EBAN-LGORT'

it_header-lgort.

PERFORM bdc_field USING 'EBAN-EKGRP'

it_header-ekgrp.

PERFORM bdc_field USING 'EBAN-MATKL'

it_header-matkl.

PERFORM bdc_field USING 'EBAN-BEDNR'

it_header-bednr.

PERFORM bdc_field USING 'EBAN-AFNAM'

it_header-afnam.

  • Item Details

v_l = 0.

  • To add no. of rows

v_2 = 0 .

  • As the screen is showing 13 rows defaulted to 130

v_rowno = 130 .

LOOP AT it_item WHERE sno = it_header-sno.

v_l = v_l + 1.

IF v_l = 14 .

IF v_2 = 12 .

v_2 = 12 .

v_l = 2 .

  • From second time onwards it is displaying 12 rows only

v_rowno = v_rowno + 120 .

PERFORM bdc_dynpro USING 'SAPMM06B' '0106'.

PERFORM bdc_field USING 'BDC_CURSOR'

'RM06B-BNFPO'.

PERFORM bdc_field USING 'RM06B-BNFPO'

v_rowno.

PERFORM bdc_field USING 'BDC_OKCODE'

'/00'.

PERFORM bdc_field USING 'BDC_OKCODE'

'/00'.

ELSE.

  • V_2 initialized to 12 for second screen purpose

v_2 = 12 .

v_l = 2 .

PERFORM bdc_dynpro USING 'SAPMM06B' '0106'.

PERFORM bdc_field USING 'BDC_CURSOR'

'RM06B-BNFPO'.

PERFORM bdc_field USING 'RM06B-BNFPO'

v_rowno .

PERFORM bdc_field USING 'BDC_OKCODE'

'/00'.

PERFORM bdc_field USING 'BDC_OKCODE'

'/00'.

ENDIF.

ENDIF.

PERFORM bdc_dynpro USING 'SAPMM06B' '0106'.

PERFORM bdc_field USING 'BDC_OKCODE'

'/00'.

CLEAR v_field.

CONCATENATE 'EBAN-MATNR(' v_l ')' INTO v_field.

PERFORM bdc_field USING v_field it_item-matnr.

CLEAR v_field.

CONCATENATE 'EBAN-MENGE(' v_l ')' INTO v_field.

PERFORM bdc_field USING v_field it_item-menge.

PERFORM bdc_dynpro USING 'SAPMM06B' '0102'.

PERFORM bdc_field USING 'BDC_CURSOR'

'EBAN-PREIS'.

PERFORM bdc_field USING 'BDC_OKCODE'

'/00'.

PERFORM bdc_field USING 'EBAN-PREIS'

it_item-preis.

PERFORM bdc_dynpro USING 'SAPMM06B' '0505'.

PERFORM bdc_field USING 'BDC_CURSOR'

'EBKN-SAKTO'.

PERFORM bdc_field USING 'BDC_OKCODE'

'=ENTE'.

PERFORM bdc_field USING 'EBKN-SAKTO'

it_item-sakto.

  • Cost Center

PERFORM bdc_dynpro USING 'SAPLKACB' '0002'.

PERFORM bdc_field USING 'BDC_CURSOR'

'COBL-KOSTL'.

PERFORM bdc_field USING 'BDC_OKCODE'

'=ENTE'.

PERFORM bdc_field USING 'COBL-KOSTL'

it_item-kostl.

PERFORM bdc_field USING 'BDC_OKCODE'

'=ENTE'.

ENDLOOP.

PERFORM bdc_dynpro USING 'SAPMM06B' '0106'.

PERFORM bdc_field USING 'BDC_CURSOR'

'RM06B-BNFPO'.

PERFORM bdc_field USING 'BDC_OKCODE'

'=BU'.

  • Call The Transaction

PERFORM bdc_transaction USING 'ME51'.

ENDLOOP.

  • Close the BDC Session

PERFORM close_group.

Former Member
0 Kudos

Hi Pinky

hope it will help you.

Reward if help.

See the following ex:

TYPES: BEGIN OF TY_MBLNR,

MBLNR LIKE MKPF-MBLNR,

END OF TY_MBLNR.

DATA: IT_MBLNR TYPE STANDARD TABLE OF TY_MBLNR WITH HEADER LINE.

data: it_ret like ddshretval occurs 0 with header line.

At selection-screen on value-request for s_mat-low.

Select MBLNR from mkpf into table it_mblnr.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

  • DDIC_STRUCTURE = ' '

RETFIELD = 'MBLNR'

  • PVALKEY = ' '

  • DYNPPROG = ' '

  • DYNPNR = ' '

  • DYNPROFIELD = ' '

  • STEPL = 0

  • WINDOW_TITLE =

  • VALUE = ' '

VALUE_ORG = 'S'

  • MULTIPLE_CHOICE = ' '

  • DISPLAY = ' '

  • CALLBACK_PROGRAM = ' '

  • CALLBACK_FORM = ' '

  • MARK_TAB =

  • IMPORTING

  • USER_RESET =

TABLES

VALUE_TAB = IT_MBLNR

  • FIELD_TAB =

RETURN_TAB = IT_RET

  • DYNPFLD_MAPPING =

  • EXCEPTIONS

  • PARAMETER_ERROR = 1

  • NO_VALUES_FOUND = 2

  • OTHERS = 3

.

IF SY-SUBRC <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

IF SY-SUBRC = 0.

read table it_ret index 1.

move it_ret-fieldval to S_mat-low.

ENDIF.

Go through the test program.

REPORT Ztest_HELP .

TABLES : MARA.

SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.

PARAMETERS : P_MATNR(10) TYPE C.

SELECTION-SCREEN END OF BLOCK B1.

DATA : BEGIN OF ITAB OCCURS 0,

MATNR TYPE MATNR,

END OF ITAB.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_MATNR.

SELECT MATNR

FROM MARA

INTO TABLE ITAB

UP TO 10 ROWS.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

RETFIELD = 'MATERIAL NUMBER'

DYNPPROG = SY-REPID

DYNPNR = SY-DYNNR

DYNPROFIELD = 'P_MATNR'

VALUE_ORG = 'S'

TABLES

VALUE_TAB = ITAB

EXCEPTIONS

PARAMETER_ERROR = 1

NO_VALUES_FOUND = 2

OTHERS = 3.

0 Kudos

Hi,

Please refer to the standard program demo_dynpro_dropdown_listbox . In that they have used the function module VRM_SET_VALUES. Use like that in your scenario.

Regards,

Renjith Michael.

Former Member
0 Kudos

Hi Pinky,

Do like this.

PROCESS ON VALUE-REQUEST.

FIELD zmat " On field zmat i have implemented F4 help

MODULE f4_help.

MODULE f4_help INPUT.

SELECT matnr

INTO TABLE it_matnr

FROM mara

UP TO 10 ROWS.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

retfield = 'Material Number'

dynpprog = 'Z3318_SCREEN'

dynpnr = '9000'

dynprofield = 'ZMAT'

value_org = 'S'

TABLES

value_tab = it_matnr

ENDMODULE. " f4_help INPUT