cancel
Showing results for 
Search instead for 
Did you mean: 

Customer service order Form

Former Member
0 Kudos

Dear all ....

I have a problem with output the data of the fleet object (license num, chassis num ..... )found in the equipment master record to the service order form (PM_Common) with printing program (RIPRJT00).

I have make a Z copy from the form and i have made the following changes in order to have these data in the printout but till now i can't have these data , so please help me to find the reason ..

I have created a program with the following code..

REPORT ZZCS0002.

TABLES FLEET.

TABLES AFIH.

TABLES EQUI.

FORM Fleet_Data TABLES IN_TAB STRUCTURE ITCSY OUT_TAB STRUCTURE ITCSY.

DATA:

I_ORDER TYPE CAUFVD-AUFNR,

I_EQUIPMENT TYPE RIWO1-EQUNR,

I_OBJECT TYPE RIWO1-OBJNR,

I_CHASSISNUM TYPE FLEET-CHASSIS_NUM,

I_LICENSENUM TYPE FLEET-LICENSE_NUM.

READ TABLE IN_TAB WITH KEY 'CAUFVD-AUFNR'.

MOVE IN_TAB-VALUE TO I_ORDER.

READ TABLE IN_TAB WITH KEY 'RIWO1-EQUNR'.

MOVE IN_TAB-VALUE TO I_EQUIPMENT.

READ TABLE IN_TAB WITH KEY 'RIWO1-OBJNR'.

MOVE IN_TAB-VALUE TO I_OBJECT.

SELECT SINGLE FLEET~LICENSE_NUM

INTO I_LICENSENUM

FROM AFIH INNER JOIN EQUI ON EQUIEQUNR = AFIHEQUNR INNER JOIN FLEET ON FLEETOBJNR = EQUIOBJNR

WHERE AFIH~AUFNR = IN_TAB-VALUE

AND FLEET~OBJNR = IN_TAB-VALUE

AND EQUI~EQUNR = IN_TAB-VALUE.

READ TABLE OUT_TAB WITH KEY NAME = 'I_LICENSENUM'.

IF SY-SUBRC = 0.

OUT_TAB-VALUE = I_LICENSENUM.

MODIFY OUT_TAB INDEX SY-TABIX.

ENDIF.

IF I_LICENSENUM IS INITIAL.

I_LICENSENUM = 'NONE'.

ENDIF.

ENDFORM.

and i have made the following changes to the sapscript form ...

/: PERFORM FLEET_DATA IN PROGRAM ZZCS0002

/: USING &CAUFVD-AUFNR&

/: USING &EQUI-EQUNR&

/: USING &EQUI-OBJNR&

/: CHANGING &I_LICENSENUM&

/: ENDPERFORM

T2 CHASSIS NUMBER : &I_LICENSENUM&

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Adel,

Please replace the following

The table name "(( AFIH INNER JOIN EQUI ON EQUIEQUNR = AFIHEQUNR )

INNER JOIN FLEET ON FLEETOBJNR = EQUIOBJNR )"

with the below code

The table name "( ( AFIH INNER JOIN EQUI ON EQUIEQUNR = AFIHEQUNR )

INNER JOIN FLEET ON FLEETOBJNR = EQUIOBJNR )" .

That means gaps should be there after (.

Please once check and let me know.If it is helpful plz reward points.

Thanks,

Suma.

Former Member
0 Kudos

Hi Suma..

the error have been disappear but i think my problem is on declaring the table fleet on the print program and that's what i don't know how to do it , os please if u can help me to do it i ll be thankfull.

Former Member
0 Kudos

Hi Adel.

Please use tthe following code

SELECT SINGLE FLEET~LICENSE_NUM
INTO I_LICENSENUM
FROM ( ( AFIH INNER JOIN EQUI ON EQUI~EQUNR = AFIH~EQUNR ) 
                      INNER JOIN FLEET ON FLEET~OBJNR = EQUI~OBJNR )
WHERE AFIH~AUFNR = I_ORDER
AND FLEET~OBJNR = I_OBJECT
AND EQUI~EQUNR =I_EQUIPMENT.

or if your where condition is according to your requiremnet means use below code.

SELECT SINGLE FLEET~LICENSE_NUM
INTO I_LICENSENUM
FROM ( ( AFIH INNER JOIN EQUI ON EQUI~EQUNR = AFIH~EQUNR ) 
                      INNER JOIN FLEET ON FLEET~OBJNR = EQUI~OBJNR )
WHERE AFIH~AUFNR = IN_TAB-VALUE
AND FLEET~OBJNR = IN_TAB-VALUE
AND EQUI~EQUNR = IN_TAB-VALUE

instead of your below code.

SELECT SINGLE FLEET~LICENSE_NUM
INTO I_LICENSENUM
FROM AFIH INNER JOIN EQUI ON EQUI~EQUNR = AFIH~EQUNR INNER JOIN FLEET ON FLEET~OBJNR = EQUI~OBJNR
WHERE AFIH~AUFNR = IN_TAB-VALUE
AND FLEET~OBJNR = IN_TAB-VALUE
AND EQUI~EQUNR = IN_TAB-VALUE.

plz reward points if helpful

Thanks,

Suma.

Former Member
0 Kudos

i hav egot the following error.

The table name "(( AFIH INNER JOIN EQUI ON EQUIEQUNR = AFIHEQUNR )

INNER JOIN FLEET ON FLEETOBJNR = EQUIOBJNR )" is too long. may not be

unique.

Former Member
0 Kudos

Hi Adel,

please use the following code

READ TABLE IN_TAB WITH KEY name = 'CAUFVD-AUFNR'.
MOVE IN_TAB-VALUE TO I_ORDER.

instead of your code

READ TABLE IN_TAB WITH KEY 'CAUFVD-AUFNR'.
MOVE IN_TAB-VALUE TO I_ORDER.

please reward points if helpful

Thanks,

Suma.