Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

The value is not coming in the work area

Former Member
0 Kudos

hello,

i had written this code in the smartform

SELECT SINGLE * FROM KNA1

INTO CORRESPONDING FIELDS OF WA_KNA1

WHERE KUNNR EQ WA_SHIP-KUNNR.

In this code the WA_SHIP-KUNNR is coming from driver program and the records are coming in WA_KNA1.

But the records are not coming in WA_KNA1.

Please Help me to resolve this problem.

1 ACCEPTED SOLUTION

messier31
Active Contributor
0 Kudos

Hi,

Make sure that workarea(header) of WA_SHIP is not blank.

Enjoy SAP.

Pankaj Singh

10 REPLIES 10

messier31
Active Contributor
0 Kudos

Hi,

Make sure that workarea(header) of WA_SHIP is not blank.

Enjoy SAP.

Pankaj Singh

Former Member
0 Kudos

Hello Pankaj,

the field WA_SHIP is not blank, the value is coming correctly what i am passing from the program.

Former Member
0 Kudos

Use this code:

 CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
    EXPORTING
      input  = wa_ship-kunnr
    IMPORTING
      output = wa_ship-kunnr.
  
  SELECT SINGLE * FROM kna1
INTO CORRESPONDING FIELDS OF wa_kna1
WHERE kunnr EQ wa_ship-kunnr.

Please mark points if the solution was useful.

Regards,

Manoj

Former Member
0 Kudos

Thanks Manoj,

I got the answer.

messier31
Active Contributor
0 Kudos

Ok.. So we see you are using smartform... So i guess you have return

your code in program logic ...

On the top of program logic there is input and output parameters. please pass your workarea wa_kna1 in both the output and input .

Let us know ur results.

Enjoy SAP.

Pankaj Singh

Former Member
0 Kudos

Please mark points for all the useful answers.

Regards,

Manoj

Former Member
0 Kudos

Go to transaction SE16 and check if that customer number is there in the table KNA1. If so, check if the SELECT statement is getting executed. I.e. It is not under any IF condition or something like that.

Please mark points if the solution was useful.

Regards,

Manoj

0 Kudos

Hello Manoj,

the value is present in the datatabase table KNA1.

i am passing from the driver program to the smartform is wa_ship-kunnr as 1800 and it is coming right in the smartform. the only problem is after executing the select query a record is not coming the wa_kna1(work area of KNA1).

Please help me.

Former Member
0 Kudos

Hi,

tye this

datA: itab like kna1.

select single * from kna1 into itab where kunnr = '0000000001'.

if sy-subrc eq 0.

endif.

check WA_SHIP-KUNNR. is having value or not

SELECT SINGLE * FROM KNA1

INTO CORRESPONDING FIELDS OF WA_KNA1

WHERE KUNNR EQ WA_SHIP-KUNNR.

thanks & regards,

Venkatesh

Former Member
0 Kudos

hi

check wa_kna1 is having filelds declaration correctly the name same as kna1 fileds names because u have used the into corresponding fields option,it requires field names similar to data base filelds

and clear work area before select

Regards

sandhya