Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

regarding update statement

Hi all,

In this report when i click on update radio button and write my desk company code and code and and then press enter so all values coming on text box. now i want to update this one

before its working fine but after i add at selection screen in this report because of that my update function not working........

can i create two internal table for that......... what to do.........................

can u give me suggestion in this report....

below is my whole coding........

REPORT ZDESKDLC NO STANDARD PAGE HEADING LINE-SIZE 255.

----


  • DATA DECLARATION

----


TABLES : ZDESKDLC.

data: itab_zdeskdlc like zdeskdlc occurs 0 with header line.

*DATA: wa like zdeskdlc.

data wa_zdeskdlc like zdeskdlc.

*clear wa_zdeskdlc.

----


  • SELECTION SCREEN

----


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

PARAMETERS: CCOD LIKE ZDESKDLC-CCODE MODIF ID ABC.

PARAMETERS: DESKCODE LIKE ZDESKDLC-DESK_CODE MODIF ID ABC.

SELECTION-SCREEN END OF BLOCK B1.

----


  • SELECTION SCREEN WITH RADIO BUTTON

----


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

PARAMETERS: DELETE RADIOBUTTON GROUP G1 USER-COMMAND R DEFAULT 'X'.

PARAMETERS: UPDATE RADIOBUTTON GROUP G1.

SELECTION-SCREEN END OF BLOCK B2.

----


  • SELECTION SCREEN

----


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

PARAMETERS: CCOD1 LIKE ZDESKDLC-CCODE MODIF ID DEF,

DESKCD LIKE ZDESKDLC-DESK_CODE MODIF ID DEF,

SR_MANAG LIKE ZDESKDLC-SR_MANAGEMENT MODIF ID DEF,

LASTNAME LIKE ZDESKDLC-LAST_NAME MODIF ID DEF,

FIRSTNM LIKE ZDESKDLC-FIRST_NAME MODIF ID DEF,

DEPART LIKE ZDESKDLC-DEPARTMENT MODIF ID DEF,

ADM_SYS LIKE ZDESKDLC-ADMIN_SYSTEM MODIF ID DEF,

RACF_ID LIKE ZDESKDLC-RACF_ID MODIF ID DEF,

OPEN_DT LIKE ZDESKDLC-OPEN_DATE MODIF ID DEF,

CLOSE_DT LIKE ZDESKDLC-CLOSE_DATE MODIF ID DEF,

SAPUSRID LIKE ZDESKDLC-SAP_USER_ID MODIF ID DEF.

SELECTION-SCREEN END OF BLOCK B3.

AT SELECTION-SCREEN OUTPUT.

IF DELETE = 'X'.

LOOP AT SCREEN.

IF SCREEN-GROUP1 = 'DEF'.

SCREEN-ACTIVE = '0'.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

ENDIF.

IF UPDATE = 'X'.

LOOP AT SCREEN.

IF SCREEN-GROUP1 = 'ABC'.

SCREEN-ACTIVE = '0'.

screen-invisible = '1'.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

ENDIF.

----


  • AT SELECTION-SCREEN.

----


AT SELECTION-SCREEN.

*if not CCOD1 is initial.

*

*clear : wa_zdeskdlc.

*

*CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'

*EXPORTING

*INPUT = CCOD1

*IMPORTING

*OUTPUT = CCOD1.

*

*

*select single * from zdeskdlc into wa_zdeskdlc

*where CCODE = CCOD1 and desk_code = deskcd.

*

*if sy-subrc eq 0.

**DESKCD = wa_zdeskdlc-DESK_CODE.

*SR_MANAG = wa_zdeskdlc-SR_MANAGEMENT.

*LASTNAME = wa_zdeskdlc-LAST_NAME.

*FIRSTNM = wa_zdeskdlc-FIRST_NAME .

*DEPART = wa_zdeskdlc-DEPARTMENT.

*ADM_SYS = wa_zdeskdlc-ADMIN_SYSTEM.

*RACF_ID = wa_zdeskdlc-RACF_ID.

*OPEN_DT = wa_zdeskdlc-OPEN_DATE.

*CLOSE_DT = wa_zdeskdlc-CLOSE_DATE.

*SAPUSRID = wa_zdeskdlc-SAP_USER_ID.

*endif.

*

*endif.

SELECT SINGLE sr_management last_name first_name department admin_system racf_id open_date close_date sap_user_id

FROM ZDESKDLC

INTO (SR_MANAG,LASTNAME,FIRSTNM,DEPART,ADM_SYS,RACF_ID,OPEN_DT,CLOSE_DT,SAPUSRID)

WHERE CCODE = CCOD1 and DESK_CODE = DESKCD.

----


  • START-OF-SELECTION

----


start-of-selection.

----


  • DELETE QUERY

----


IF DELETE = 'X'.

DELETE from zdeskdlc where

CCODE = CCOD AND

DESK_CODE = DESKCODE.

IF SY-SUBRC = 0.

MESSAGE s001(zjig) WITH 'data delete successfully'.

ELSE.

MESSAGE s001(zjig) WITH 'NO RECORD FOUND'.

ENDIF.

ENDIF.

----


  • UPDATE QUERY

----


*start-of-selection.

IF UPDATE = 'X'.

zdeskdlc-CCODE = CCOD1.

zdeskdlc-DESK_CODE = DESKCD.

zdeskdlc-SR_MANAGEMENT = SR_MANAG.

zdeskdlc-LAST_NAME = LASTNAME.

zdeskdlc-FIRST_NAME = FIRSTNM.

zdeskdlc-DEPARTMENT = DEPART.

zdeskdlc-ADMIN_SYSTEM = ADM_SYS.

zdeskdlc-RACF_ID = RACF_ID.

zdeskdlc-OPEN_DATE = OPEN_DT.

zdeskdlc-CLOSE_DATE = CLOSE_DT.

zdeskdlc-SAP_USER_ID = SAPUSRID.

  • SR_MANAG = wa_zdeskdlc-SR_MANAGEMENT .

  • LASTNAME = wa_zdeskdlc-LAST_NAME .

  • FIRSTNM = wa_zdeskdlc-FIRST_NAME .

  • DEPART = wa_zdeskdlc-DEPARTMENT .

  • ADM_SYS = wa_zdeskdlc-ADMIN_SYSTEM .

  • RACF_ID = wa_zdeskdlc-RACF_ID .

  • OPEN_DT = wa_zdeskdlc-OPEN_DATE .

  • CLOSE_DT = wa_zdeskdlc-CLOSE_DATE .

  • SAPUSRID = wa_zdeskdlc-SAP_USER_ID .

MODIFY ZDESKDLC.

*insert ZDESKDLC.

IF SY-SUBRC = 0.

MESSAGE s001(zjig) WITH 'data modify successfully'.

ENDIF.

ENDIF.

zenithi..

Tags:
Former Member
Not what you were looking for? View more on this topic or Ask a question