Application Development and Automation 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: 
Read only

dialog problem

Former Member
0 Likes
648

HI,

this is vijay here.

my problem is remain here.

well i wanna jus one hint.

well i have one screen on that i hav one i/o field , for that fields i m getting the f4 help by function module but my question is that when i m going for change and selecting the f4 value in list and after change and save it is not reflecting in the database properly well could u explain me or give me some code regarding that problem.

thanks and regards

vijay dwivedi

rewards will b sure*

4 REPLIES 4
Read only

Former Member
0 Likes
575

Hi Vijay,

If the field you have on the selections screen refers to an existing field in SAP you can get the F4 values by referencing it <b>SELECT-OPTIONS: S_TKNUM FOR VTTP-TKNUM</b>. i.e:

SELECTION-SCREEN BEGIN OF BLOCK A WITH FRAME TITLE TEXT-C01.
  SELECT-OPTIONS: S_TKNUM FOR VTTP-TKNUM. "Shipment Number
SELECTION-SCREEN END OF BLOCK A.

However if the field is bespoke can you supply me with the FM you are using to generate the F4 results, a sample of the code would be perfect.

Regards,

Philip Johannesen

Read only

Former Member
0 Likes
575

Hi,

After pressing the F4, just insert the record in the DATABASE table

use the SET statment to insert the record

Regards

Sudheer

Read only

0 Likes
575

hi sudheer,

plz look at my code and try to correct it this is very urgent to me.

&----


*& Module pool SAPMZA_BGTYPE

*&

&----


*&

*&

&----


PROGRAM SAPMZA_BGTYPE.

TABLES: ZFIT_BGTYPE.

DATA: W_CSAV(1).

DATA: W_NSAV(1).

DATA: BEGIN OF W_BGTYPE,

BG_TYPE1 TYPE ZFIT_BGTYPE-BG_TYPE,

END OF W_BGTYPE.

DATA: ok_code TYPE sy-ucomm OCCURS 0 WITH HEADER LINE.

DATA: BEGIN OF T_BGTYPE OCCURS 0,

BG_TYPE LIKE ZFIT_BGTYPE-BG_TYPE,

END OF T_BGTYPE.

&----


*& Module USER_COMMAND_0100 INPUT

&----


  • text

----


MODULE USER_COMMAND_9000 INPUT.

IF SY-UCOMM = 'NEW'.

loop at screen.

if screen-group1 = '001'.

screen-ACTIVE = '1'.

modify screen.

endif.

endloop.

W_NSAV = 1.

ENDIF.

CASE OK_CODE.

WHEN 'BACK' .

LEAVE PROGRAM.

ENDCASE.

ENDMODULE. " USER_COMMAND_9000 INPUT

&----


*& Module STATUS_9000 OUTPUT

&----


  • text

----


MODULE STATUS_9000 OUTPUT.

SET PF-STATUS 'BUTTONS'.

  • SET TITLEBAR 'xxx'.

ENDMODULE. " STATUS_9000 OUTPUT

&----


*& Module value_help INPUT

&----


  • text

----


MODULE value_help INPUT.

select BG_TYPE from ZFIT_BGTYPE

into corresponding fields of table T_BGTYPE.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

  • DDIC_STRUCTURE = 'ZFIT_BGTYPE'

RETFIELD = 'BG_TYPE'

  • PVALKEY = ' '

DYNPPROG = 'SAPMZA_BGTYPE'

DYNPNR = '0100'

DYNPROFIELD = 'ZFIT_BGTYPE-BG_TYPE'

  • STEPL = SY-STEPL

  • WINDOW_TITLE =

  • VALUE = ' '

VALUE_ORG = 'S'

  • MULTIPLE_CHOICE = ' '

  • DISPLAY = ' '

  • CALLBACK_PROGRAM = ' '

  • CALLBACK_FORM = ' '

  • MARK_TAB =

  • IMPORTING

  • USER_RESET =

TABLES

VALUE_TAB = T_BGTYPE

  • FIELD_TAB =

  • RETURN_TAB =

  • 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.

*T_BGTYPE-BG_TYPE =

ENDMODULE. " value_help INPUT

&----


*& Module SAVE INPUT

&----


  • text

----


MODULE SAVE INPUT.

IF OK_CODE = 'SAVE'.

IF W_CSAV = 1.

*DELETE ZFIT_BGTYPE FROM W_BGTYPE .

  • MODIFY ZFIT_BGTYPE FROM T_BGTYPE.

MODIFY ZFIT_BGTYPE set bg_type = zfit_bgtype-bg_type.

  • UPDATE ZFIT_BGTYPE FROM W_BGTYPE .

COMMIT WORK.

CLEAR W_BGTYPE.

  • IF SY-SUBRC = 0.

*

  • COMMIT WORK.

*

  • ENDIF.

ENDIF.

ELSEIF W_NSAV = 1.

INSERT ZFIT_BGTYPE.

ENDIF.

CASE SY-UCOMM.

WHEN 'NEW'.

CLEAR ZFIT_BGTYPE.

WHEN 'REFRESH'.

CLEAR ZFIT_BGTYPE.

ENDCASE.

ENDMODULE. " SAVE INPUT

&----


*& Module set_screen_9000 OUTPUT

&----


  • text

----


MODULE set_screen_9000 OUTPUT.

IF sy-ucomm = 'CHANGE'.

loop at screen.

screen-active = '1'.

screen-input = '1'.

modify screen.

endloop.

ELSEIF SY-UCOMM EQ 'NEW'.

LOOP AT SCREEN.

check screen-group1 = '001'.

screen-input = '1'.

modify screen.

endloop.

ELSE.

LOOP AT SCREEN.

check screen-group1 = '001'.

screen-input = '0'.

modify screen.

endloop.

ENDIF.

ENDMODULE. " set_screen_9000 OUTPUT

&----


*& Module change INPUT

&----


  • text

----


MODULE change INPUT.

IF SY-UCOMM = 'CHANGE'.

LOOP AT SCREEN.

check screen-group1 = '001'.

screen-ACTIVE = '1'.

modify screen.

ENDLOOP.

W_CSAV = 1.

SELECT SINGLE * FROM ZFIT_BGTYPE

INTO CORRESPONDING FIELDS OF W_BGTYPE .

ENDIF.

ENDMODULE. " change INPUT

&----


*& Module set_status_9000 OUTPUT

&----


  • text

----


MODULE set_status_9000 OUTPUT.

  • clear OK_CODE[].

  • IF SY-UCOMM NE 'NEW'.

  • APPEND 'SAVE' TO OK_CODE.

  • endif.

  • set pf-status 'BUTTONS' excluding OK_CODE.

ENDMODULE. " set_status_9000 OUTPUT

thanks and regards

vijay

Read only

Former Member
0 Likes
575

Hi Vijay,

plz check the OK code of ur save button, i think the value in the i/o field is not changing b'coz of the okcode of the Save.

thanks

ganesh