cancel
Showing results for 
Search instead for 
Did you mean: 

Link table NAST to Smartform

Former Member
0 Kudos

Hello,

I want to add a field from table NAST (MANUE) to a SMARTFORM. The problem is that I cannot find a field

to link table NAST to a field from the fieldlist. The Smartform is a picklist and I would like to link table NAST to IS_DLV_DELNOTE-HD_GEN. However in table NAST there is a field called OBJKY and in this field the delivery number is written, for example 0080001933. The delivery number is 80001933. I added the following program rules, but without result:

tables: NAST.

select SINGLE OBJKY into G_DELIVERY

from nast.

where OBJKY = IS_DLV_DELNOTE-HD_GEN-DELIV_NUMB.

What program code has to be added to delete the two leading zero's from the field NAST-OBJKY to make the output of this field identical to the output of field IS_DLV_DELNOTE-HD_GEN-DELIV_NUMB and that the tables can be linked.

Thx.

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi all ,

if u want to find any conversion u go to its domain and check for the conversion esist...

and for the document numbers id u want to ADD leading zeros u can use CONVERSION_EXIT_ALPHA_INPUT....

if u want to remove leading zeroes u have to use .... CONVERSION_EXIT_ALPHA_OUTPUT

hope this helps .................

Former Member
0 Kudos

Sorry, can you maybe explain a little bit more what you mean by 'if you want to find any conversie you go to its domain and check if the conversion exist'. And where can I check this?

Thx.

Former Member
0 Kudos

hi Ivo Glastra ,

for some values in the sap , they are stored differrently from what they apperar ..... for eg language , when u observe the language its shown with 2 character like 'EN' 'DE' etc ... but when u saw them in table it will be store as single character... go and check in KNA1... now lets say u want to convert them .... user will enter 2 character languge ....now u need to use conversion exit ... for that go to se11 ...open kna1... doble click on data element SPRAS ...It will show domain of that... double click on the domain ... now in definition tab ... u ll find Convers. Routine .... double click on that .... it will open one window list of function module names... there will be 2 function modue with nam " *_INPUT" and " *_OUTPUT " if u use input method it will convert from external format to internal ... if u use output it will convert internal to external format ..........

Hope this helps ...rewrd if helpful ..............

naimesh_patel
Active Contributor
0 Kudos

Why don't you use the Conversion Exit CONVERSION_EXIT_ALPHA_INPUT to append leading zero before selecting from the NAST?

Like:


  CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
    EXPORTING
      input  = IS_DLV_DELNOTE-HD_GEN-DELIV_NUMB
    IMPORTING
      output = IS_DLV_DELNOTE-HD_GEN-DELIV_NUMB.

select SINGLE OBJKY into G_DELIVERY
from nast.
where OBJKY = IS_DLV_DELNOTE-HD_GEN-DELIV_NUMB.

Regards,

Naimesh Patel

Former Member
0 Kudos

Thx for your reaction, but it still doesn't work. In the global definitions I created a field named Z_MANUEL. In this field I would like to place the value from the field NAST-MANUE. Further I created a field named Z_DELIVERYNAST in which I place the delivery number, beacause SAP gives the message IS_DLV_DELNOTE-HD_GEN-DELIV_NUMB cannot be changed.

CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'

EXPORTING

input = IS_DLV_DELNOTE-HD_GEN-DELIV_NUMB

IMPORTING

output = IS_DLV_DELNOTE-HD_GEN-DELIV_NUMB.

select SINGLE OBJKY into G_DELIVERY

from nast.

where OBJKY = IS_DLV_DELNOTE-HD_GEN-DELIV_NUMB.

What program rules should I add so that SAP writes the value of NAST-MANUE in the field Z_MANUEL?

Or is there anaother way in which I can add table NAST to the field list in my Smartform? Thx in advance

dhirendra_pandit
Active Participant
0 Kudos

Hi Ivo,

Go to Form Interface and make check the IS_DLV_DELNOTE 'Pass value' check box then your code will work well.

Cheers

Dhirendra

Former Member
0 Kudos

Hi

I suppose the field IS_DLV_DELNOTE-HD_GEN-DELIV_NUMB should have the correct value, i.e. with leading zero.

U should check (by debug) which value is stored there, if u need to add the leading zero u can use the fm CONVERSION_EXIT_ALPHA_INPUT

Max