cancel
Showing results for 
Search instead for 
Did you mean: 

PAN no not displayed in the Work Order

Former Member
0 Kudos

hi friends.we are creating work orders bt the PAN no in it is not displayed.i know which smartform is used for it.Please guide me if i want to display the PAN no also.actually in graphics there is window for PAN bt in print preview it doesnt pick the value from the database.Please guide me where i should write the code to read data from the database and display the PAN in its field.

In "form interface" under "tables" the table list doesn't contain table LFA1 which contains the PAN no of vendor.I think that may be the problem. Please guide me.

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member217544
Active Contributor
0 Kudos

Hi Achal,

Try this way:

You may be getting the work order number as input to the already existing smartform. Check if there are any tables that link the work order number with the pan number (Iam not aware of the tables related to work order).

Once you get the table, then use a select query to fetch the pan number for that corresponding work order.(Select query can be placed either in the initialization tab of global definitions or create a program lines in the window)

To display the pan number on print:

You mentioned as a graphic is present at present. Graphic node is used to display the logo or picture kind of outputs.

To display your pan number - either select a separate window or create a new node in the already existing window. Now pass the variable which you got from the above select query and print the same.

Hope my understanding on your query is correct.

Regards,

Swarna Munukoti.

Former Member
0 Kudos

no no swarna i doesnt mean graphic i mean the txt space is there for printing the PAN.Now i gt the right field.

the code written inside it is as follows :

if ZXEKKO-BSART = 'PU07' .
data : adr2 type EKPO-ADRNR.
DATA : C_ZADRC LIKE ADRC.
CLEAR : ADR2,L_XEKPO,C_ZADRC.
read table L_XEKPO index 1.
if l_xekpo-adrn2 is not initial.
adr2 = l_xekpo-adrn2.
else. "if l_xekpo-adrnr is not initial.
adr2 = l_xekpo-adrnr.
endif.
select single * from adrc into C_ZADRC where  ADDRNUMBER = adr2.
clear FOR_PROJ.
FOR_PROJ = C_ZADRC-NAME1.
ENDIF.

it is written under the "general attributes" tab.but here the "PU07" is the doc type for the service PO.in system the doc type for the subcon work order is "PU05".

i have added PU05 with PU07 using AND then save the changes and then activate the form bt still i am not getting the PAN no.where should i make the changes

former_member217544
Active Contributor
0 Kudos

Hi Achal,

As you want it for both PU07 and PU05, you need to use 'OR' operator.


if ZXEKKO-BSART = 'PU07' OR
 ZXEKKO-BSART = 'PU05' .

Also it seems FOR_PROJ = C_ZADRC-NAME1 is related to a customer name but not a PAN number.

Is this the corerct text node you are looking for? (Assuming you are using the variable FOR_PROJ for printing)

Regards,

Swarna Munukoti

Edited by: Swarna Munukoti on Dec 24, 2009 1:18 PM

Former Member
0 Kudos

I HAVE CHANGED THE CODE TO FOLLOWING:

if ZXEKKO-BSART = 'PU07'OR
 ZXEKKO-BSART = 'PU05' .

data : adr2 type EKPO-ADRNR.
DATA : C_ZADRC LIKE ADRC.
CLEAR : ADR2,L_XEKPO,C_ZADRC.
read table L_XEKPO index 1.
TABLES LFA1.   "EXTRA CODE
if l_xekpo-adrn2 is not initial.
adr2 = l_xekpo-adrn2.
else. "if l_xekpo-adrnr is not initial.
adr2 = l_xekpo-adrnr.
endif.
"select single * from adrc into C_ZADRC where  ADDRNUMBER = adr2.
"clear FOR_PROJ.
"FOR_PROJ = C_ZADRC-NAME1.
select * from LFA1 where LIFNR = 100076.
   FOR_PROJ = LFA1-STENR.
ENDSELECT.   
ENDIF.

BUT STILL IT IS NOT WORKING. one thing more in the print preview it is showing the value entered in the field "your reference" under "communication" tab

former_member217544
Active Contributor
0 Kudos

Hi Achal,

One option is place a BREAK-POINT statement at the end of the program lines and check the value FOR_PROJ.

Also I will suggest you to remove select , endselect.

Change your code as follows:


if ZXEKKO-BSART = 'PU07'OR
 ZXEKKO-BSART = 'PU05' .
 
data : adr2 type EKPO-ADRNR.
DATA : C_ZADRC LIKE ADRC,
           V_STENR LIKE LFA1-STENR.
CLEAR : ADR2,L_XEKPO,C_ZADRC.
read table L_XEKPO index 1.
if l_xekpo-adrn2 is not initial.
adr2 = l_xekpo-adrn2.
else. "if l_xekpo-adrnr is not initial.
adr2 = l_xekpo-adrnr.
endif.
"select single * from adrc into C_ZADRC where  ADDRNUMBER = adr2.
"clear FOR_PROJ.
"FOR_PROJ = C_ZADRC-NAME1.
select STENR from LFA1 INTO V_STENR where LIFNR = 100076.
Break-point.    " keep break-point and check v_stenr value
   FOR_PROJ = V_STENR.
Break-point. " Keep break-point and check for_proj value

ENDIF.

Also, cross cehck whether FOR_PROJ is teh field you are using in the text element.

Regards,

Swarna Munukoti

Former Member
0 Kudos

no its not working....i am very new to ABAP how could i check the value with breakpoint.

Former Member
0 Kudos

HI SWARNA I HAVE PASSED HARD CORE VALUE LIKE :

clear FOR_PROJ.
FOR_PROJ = 12345678.

STILL IT IS NOT REFLECTING THERE.i want to mention again ,if in PO i wite somthing in the field "your ref." under "communication" tab then the value in it is displayed in pint preview.

Former Member
0 Kudos

I have also tried to comment out the all code for it.but nothing happned to the print preview. ,if in PO i wite somthing in the field "your ref." under "communication" tab then the value in it is displayed in print preview aginst the field PAN no where i want the PAN no..