cancel
Showing results for 
Search instead for 
Did you mean: 

Error in application WEB Dynpro

Former Member
0 Kudos

Hi experts, I am programming a Web dynpro and I have two inputs (Class Sales Organization and Sales), when run i get this error "A dynamically specified column name is unknown", this is the code:

The method is the search button

Declaración de datos

   DATA: lo_el_context TYPE REF TO if_wd_context_element,

         ls_context    TYPE wd_this->element_context,

         lv_vkorg      TYPE wd_this->element_context-vkorg,

         lv_auart      TYPE wd_this->element_context-auart.

*Obtener elementos vía selección

   lo_el_context = wd_context->get_element( ).

*Obtener un unico atributo

   lo_el_context->get_attribute(

   EXPORTING

     name  = 'VKORG'

   IMPORTING

     value = lv_vkorg  ).

*Obtener elementos vía selección

   lo_el_context = wd_context->get_element( ).

*Obtener un unico atributo

   lo_el_context->get_attribute(

   EXPORTING

     name  = 'AUART'

   IMPORTING

     value = lv_vkorg  ).

*Declaración de datos para tabla

   DATA: lt_hdr TYPE STANDARD TABLE OF VBAK,

         ls_cond TYPE c,

         lt_cond LIKE TABLE OF ls_cond.

*Condición

   CONCATENATE 'VKORG = ''' lv_vkorg '''' INTO ls_cond.

   APPEND ls_cond TO lt_cond.

   CONCATENATE 'AUART = ''' lv_auart '''' INTO ls_cond.

   CONCATENATE 'AND' ls_cond INTO ls_cond SEPARATED BY space.

   APPEND ls_cond TO lt_cond.

This piece of code generates the error me

   SELECT vbeln erdat erzet auart vkorg

     FROM vbak

     INTO TABLE lt_hdr

     WHERE (lt_cond).

*

*Declarar datos de cabecera

   DATA: lo_nd_header TYPE REF TO if_wd_context_node.

*Navegar desde CONTEXT hacia HEADER via selección

   lo_nd_header  = wd_context->get_child_node( name  = wd_this->wdctx_header ).

*Declarar todos los atributos

   lo_nd_header->bind_table( lt_hdr ).

Please can you help me.

Best Regards.

Accepted Solutions (0)

Answers (3)

Answers (3)

ramakrishnappa
Active Contributor
0 Kudos

Hi Brujo,

The runtime error is pointing to the issue in WHERE condition i.e. lt_cond table is not having valid field names specified.

Error in the below code :

*Declaración de datos para tabla

   DATA: lt_hdr TYPE STANDARD TABLE OF VBAK,

         ls_cond TYPE c,

         lt_cond LIKE TABLE OF ls_cond.

As ls_cond declared as type "C" , it can take only 1 char, hence lt_cond is filled with incorrect condition

Correct the same as below

   DATA: lt_hdr TYPE STANDARD TABLE OF VBAK,

          ls_cond type string,

         lt_cond LIKE TABLE OF ls_cond.

Hope it helps you.

Regards,

Rama

Former Member
0 Kudos

Thanks, is correct

nishantbansal91
Active Contributor
0 Kudos

HI Brujo,


Please maintain the proper spacing between the variable.


   CONCATENATE 'VKORG = ''' lv_vkorg '''' INTO ls_cond.

   APPEND ls_cond TO lt_cond.


  Your code " CONCATENATE 'AUART = ''' lv_auart '''' INTO ls_cond.

              CONCATENATE ' AUART = ''' lv_auart '''' INTO ls_cond.


  

  Your code "CONCATENATE 'AND' ls_cond INTO ls_cond SEPARATED BY space.

  

            "CONCATENATE ' AND' ls_cond INTO ls_cond SEPARATED BY space.

  

APPEND ls_cond TO lt_cond.

Please give the space before staring the AUART and AND .

Regards..

Nishant Bansal

ramakrishnappa
Active Contributor
0 Kudos

Hi Brujo,

Is your  issue resolved ? if so, please mark the thread as answered so that it can help others.

Regards,

Rama

Former Member
0 Kudos

Hello ,

Sorry to say but he can't mark your Answer as Correct and Helpful, Because this is a discussion not a Question, He missed to mark this discussion as "Question".

BR

ChanS.

p.s.: Please mark your discussion as question, if its not a simple discussion(like this thread).

ramakrishnappa
Active Contributor
0 Kudos

Hi Chandra,

Thank you for the clarification.

Regards,

Rama

former_member205842
Participant
0 Kudos

Hi Ram,

                 Am executing bapi with 2 different records in webdynpro abap , bapi executing successfully but the problem am facing is, in databse table it storing with first record multiple times it is not taking 2nd record ....i kept debugger n i checked in bapi that it taking 2 different records but while storing in bdtable, it storing single record multiple times .. .please help to solve this its adj..

ramakrishnappa
Active Contributor
0 Kudos

Hi,

Your issue is not relevant to this thread. Hence, I suggest you to create a new question and post

Regards,

Rama

former_member205842
Participant
0 Kudos

yah i created new post waiting for approvel .....i need to clear  error....

ramakrishnappa
Active Contributor
0 Kudos

Hi,

Is new post created ?

What do you mean "Waiting for approval".

Regards,

Rama

former_member205842
Participant
0 Kudos

when i post the comment it said waiting for approvel...dont what is that

Former Member
0 Kudos

SELECT vbeln erdat erzet auart vkorg

     FROM vbak

     INTO TABLE lt_hdr

     WHERE (lt_cond).

Error is because VBAK have no. of field and you fetching data for some field only 'vbeln'... So as kiran suggested please try with Corresponding filed of table.  because at run time query unable to find corresponding fields...

one more thing, have you created the node using whole "VBAK" table,means all attribute, because you are binding table with lt_hdr, but you are fetching data for only 5 fields so i don't thing that your node have all attribute as like VBAK field, so why you are binding table with lt_hdr.

lo_nd_header->bind_table( lt_hdr ).

I will suggest you to read the table node and then apply the query on that only using Corresponding filed of table..and bind that lt_node with table.

former_member184578
Active Contributor
0 Kudos

Hi,

Use INTO CORRESPONDING FIELDS OF TABLE lt_hdr instead of INTO TABLE.

Or create a local structure with only those 4 fields which you want to fetch using Types and use INTO TABLE .

Regards,

Kiran