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: 

bdc

Former Member
0 Kudos
56

how do u select a flat file which is in the desktop by selecting f4 in the selection screen (ie with out typing the name of flat file in the selection screen)

3 REPLIES 3

amit_khare
Active Contributor
0 Kudos
31

Welcome to SDN.

Use F4_FILENAME function module for that.

PARAMETERS: P_UFILE TYPE IBIPPARMS-PATH,

AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_UFILE.

CALL FUNCTION 'F4_FILENAME'

EXPORTING

PROGRAM_NAME = SY-REPID

DYNPRO_NUMBER = SYST-DYNNR

  • FIELD_NAME = ' '

IMPORTING

FILE_NAME = P_UFILE

.

Regards,

Amit

Reward all helpful replies.

Former Member
0 Kudos
31

SELECTION-SCREEN : BEGIN OF BLOCK blk2 WITH FRAME TITLE text-002.

PARAMETERS : p_apath TYPE ibipparms-path, ""Server path

p_afile TYPE ibipparms-path, "server file name

p_filnam TYPE rlgrap-filename. " persentation server path+file

SELECTION-SCREEN END OF BLOCK blk2.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_filnam.

CALL FUNCTION 'F4_FILENAME'

EXPORTING

program_name = syst-cprog

dynpro_number = syst-dynnr

field_name = 'p_filnam '

IMPORTING

file_name = p_filnam.

Former Member
0 Kudos
31

hi,

check this logic.

TABLES : IBIPPARMS.

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

*& Types

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

TYPES : BEGIN OF TY_ITAB,

MATNR TYPE MATNR, "MATERIAL NO

WERKS TYPE WERKS, "PLANT

STLAN TYPE STLAN, "BOM USAGE

DATUV TYPE DATUV, "VALID DATE

BMENG TYPE BMENG, "BASE QUANTITY

IDNRK TYPE IDNRK, "COMPONENT

MENGE TYPE RC29P-MENGE, "QUANTITY

MEINS TYPE MEINS, "UNIT

POSTP TYPE POSTP, "ITEM CATEGORY

END OF TY_ITAB.

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

*& DATA Declaration

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

DATA : IT_ITAB TYPE TABLE OF TY_ITAB WITH HEADER LINE.

DATA : IT_BDCDATA TYPE TABLE OF BDCDATA WITH HEADER LINE.

DATA : IT_BDCMSGCOLL TYPE TABLE OF BDCMSGCOLL WITH HEADER LINE.

DATA : P_FILE1 TYPE STRING ,"FILE NAME

V_LINES TYPE I.

DATA : IT1_ITAB like IT_ITAB occurs 0 with header line.

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

*& SELECTION-SCREEN DECLARATION

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

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

PARAMETERS : P_FILE TYPE LOCALFILE OBLIGATORY."FILE NAME

SELECTION-SCREEN END OF BLOCK B1 .

----


AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FILE.

----


clear : P_FILE.

CALL FUNCTION 'F4_FILENAME'

EXPORTING

PROGRAM_NAME = SYST-CPROG

DYNPRO_NUMBER = SYST-DYNNR

IMPORTING

FILE_NAME = P_FILE.