Skip to Content
0
Former Member
Jan 17, 2008 at 07:53 AM

codes

13 Views

hi gurus,

what is used for change the few fields of an itab in a report if the data

are fill in fields of parameters.

also change the contents of table .

yes i change the fields of itab that is created by me and wants some specifioc change those fields data that are saved in itab.

like this coding

TABLES: S225.

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

*INTERNAL TABLE

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

DATA: BEGIN OF LT_OUTPUT OCCURS 0,

MANDT LIKE S225-MANDT,

SSOUR LIKE S225-SSOUR,

VRSIO LIKE S225-VRSIO,

SPMON LIKE S225-SPMON,

SPTAG LIKE S225-SPTAG,

SPWOC LIKE S225-SPWOC,

SPBUP LIKE S225-SPBUP,

WERKS LIKE S225-WERKS,

DISPO LIKE S225-DISPO,

MATNR LIKE S225-MATNR,

VERID LIKE S225-VERID,

MDV01 LIKE S225-MDV01,

MDV02 LIKE S225-MDV02,

KDAUF LIKE S225-KDAUF,

KDPOS LIKE S225-KDPOS,

PSPNR LIKE S225-PSPNR,

END OF LT_OUTPUT.

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

  • D A T A

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

*DATA: OK_CODE TYPE C.

DATA: ITAB LIKE LT_OUTPUT OCCURS 0 WITH HEADER LINE.

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

  • SELECTION SCREEN / PARAMETERS *

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

SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.

SELECT-OPTIONS:S_spmon FOR s225-spmon OBLIGATORY,

s_sptag FOR s225-sptag OBLIGATORY,

S_MATNR FOR S225-MATNR OBLIGATORY,

S_MANDT FOR S225-MANDT NO-EXTENSION NO INTERVALS OBLIGATORY,

S_SSOUR FOR S225-SSOUR NO-EXTENSION NO INTERVALS OBLIGATORY,

S_VRSIO FOR S225-VRSIO NO-EXTENSION NO INTERVALS OBLIGATORY,

S_SPWOC FOR S225-SPWOC NO-EXTENSION NO INTERVALS OBLIGATORY,

S_SPBUP FOR S225-SPBUP NO-EXTENSION NO INTERVALS OBLIGATORY,

S_WERKS FOR S225-WERKS NO-EXTENSION NO INTERVALS OBLIGATORY,

S_DISPO FOR S225-DISPO NO-EXTENSION NO INTERVALS OBLIGATORY,

S_VERID FOR S225-VERID NO-EXTENSION NO INTERVALS OBLIGATORY,

S_MDV01 FOR S225-MDV01 NO-EXTENSION NO INTERVALS OBLIGATORY,

S_MDV02 FOR S225-MDV02 NO-EXTENSION NO INTERVALS OBLIGATORY,

S_KDAUF FOR S225-KDAUF NO-EXTENSION NO INTERVALS OBLIGATORY,

S_KDPOS FOR S225-KDPOS NO-EXTENSION NO INTERVALS OBLIGATORY,

S_PSPNR FOR S225-PSPNR NO-EXTENSION NO INTERVALS OBLIGATORY.

SELECTION-SCREEN END OF BLOCK b1.

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

PARAMETERS: P1 AS CHECKBOX,

P2 AS CHECKBOX.

SELECTION-SCREEN END OF BLOCK b2.

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

  • START OF SELECTION

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

START-OF-SELECTION.

PERFORM GET_DATA.

PERFORM DELETE_DATA.

*forms to fetch data in fields

FORM GET_DATA.

SELECT MANDT

SSOUR

VRSIO

SPMON

SPTAG

SPWOC

SPBUP

WERKS

DISPO

MATNR

VERID

MDV01

MDV02

KDAUF

KDPOS

PSPNR

INTO CORRESPONDING FIELDS OF TABLE LT_OUTPUT

FROM S225

WHERE SPMON IN S_SPMON AND

SPTAG IN S_SPTAG AND

MATNR IN S_MATNR.

ENDFORM.

*form for delete data

FORM DELETE_DATA.

if P1 = 'X'.

DELETE ITAB.

MESSAGE I002 WITH 'Data is Deleted'.

elseif P2 = 'X'.

READ TABLE ITAB WITH KEY = ITAB-MATNR.

MODIFY TABLE ITAB.

IF SY-SUBRC = 0.

INSERT ITAB INDEX SY-TABIX.

MESSAGE S004 WITH 'Data is Saved Successfully'.

ENDIF.

ENDIF.

is it write or it work that i write the codes init.

Edited by: jayant kumar on Jan 17, 2008 9:04 AM