Skip to Content
0
Former Member
Oct 23, 2006 at 01:50 PM

SAP SCRIPT--URGENT

23 Views

HI SAP GUYS I HAVE DOUPT

REGARDING SCRIPTS I AM FETCHING DATA INTO FORM BY USING SUB ROUTINES

I AM GIVING BELOW

THIS IS GOING TO DUMP

REPORT ZF110_TMF_CHK2_PERFORM.

TABLES: ZCRM_R3,

REGUP.

&----


*& Form DATA_EXTRACT

&----


FORM DATA_EXTRACT TABLES T_IN3 STRUCTURE ITCSY

T_OUT3 STRUCTURE ITCSY.

DATA : L_BUTXT LIKE T001-BUTXT.

DATA : BUKRS LIKE BSEG-BUKRS.

CLEAR T_IN3.

CLEAR T_OUT3.

READ TABLE T_IN3 WITH KEY 'REGUP-BUKRS' .

MOVE T_IN3-VALUE TO BUKRS.

SELECT SINGLE BUTXT FROM T001

INTO L_BUTXT

WHERE BUKRS = BUKRS.

READ TABLE T_OUT3 WITH KEY 'BUTXT' .

MOVE L_BUTXT TO T_OUT3-VALUE.

MODIFY T_OUT3 INDEX SY-TABIX.

ENDFORM. "DATA_EXTRACT

FORM DATA_EXTRACT1 TABLES T_IN STRUCTURE ITCSY

T_OUT STRUCTURE ITCSY.

DATA : L_NAME1 LIKE KNA1-NAME1,

L_NAME2 LIKE KNA1-NAME2,

VERTN LIKE REGUP-VERTN,

L_NAME(35),

L_VERTN(16),

L_CUSTOMER LIKE ZCRM_R3-CUSTOMER,

L_INT(20).

CLEAR T_IN.

CLEAR T_OUT.

READ TABLE T_IN WITH KEY 'REGUP-VERTN' .

MOVE VERTN TO L_VERTN.

CALL FUNCTION 'HRPBSNO_FORMAT_ZERO'

EXPORTING

LEFT = 16

RIGHT = 0

  • SEPARATOR =

CHANGING

STR = L_VERTN

.

SELECT SINGLE CUSTOMER FROM ZCRM_R3

INTO L_CUSTOMER

WHERE ALLOCATION_ID = L_VERTN.

MOVE L_CUSTOMER TO L_INT.

CALL FUNCTION 'HRPBSNO_FORMAT_ZERO'

EXPORTING

LEFT = 10

RIGHT = 0

  • SEPARATOR =

CHANGING

STR = L_INT.

READ TABLE T_OUT WITH KEY 'NAME' .

MOVE L_NAME TO T_OUT-VALUE.

MODIFY T_OUT INDEX SY-TABIX.

ENDFORM. "DATA_EXTRACT1