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: 

DYNAMIC TABLE TO INTERNAL TABLE

joaquinE
Explorer
0 Kudos
555
I need to convert a dynamic table to an internal one for the program to work, I leave the code below<br><strong>I NEED TO CREATE AN INTERNAL TABLE WITH THE VALUES OF THE DYNAMIC ONE CALLED 'tdinamica'</strong>


PARAMETERS: tablaN TYPE dd02l-tabname.<br>
DATA: btn_ok TYPE sy-ucomm.<br>
DATA tdinamica TYPE REF TO DATA.<br>
field-symbols: <fs>.<br>
*VARIABLES ALV<br>
DATA:<br>
*      it_usuarios type table of ZTBL_EMPLEADO , "DATOS TABLA INTERNA | INFORMACIÓN A MOSTRAR"<br>
  it_fcat      TYPE STANDARD TABLE OF lvc_s_fcat, "CATALOGO DE CAMPOS DE ALV | COLUMNAS DEL ALV"<br>
  vg_container TYPE REF TO cl_gui_custom_container, "OBJETO DEL CONTENEDOR"<br>
  obj_alv_grid TYPE REF TO cl_gui_alv_grid. "MÉTODOS DE LA CLASE ESTANDAR DE ALV TIPO GRID"<br>
CREATE DATA tdinamica TYPE (tablaN).<br>
ASSIGN tdinamica TO <fs>.<br>
*CLASE INTERNA<br>
CLASS cls_alv01 DEFINITION DEFERRED.<br>
DATA: obj_alv_01 TYPE REF TO cls_alv01.<br><br><br>
SPAN {
font-family: "Courier New";
font-size: 10pt;
color: #000000;
background: #FFFFFF;
}.L0S31 {
font-style: italic;
color: #808080;
}.L0S52 {
color: #0000FF;
}.L0S55 {
color: #800080;
}.L0S70 {
color: #808080;I NEED TO CREATE AN INTERNAL TABLE WITH THE VALUES OF THE DYNAMIC ONE CALLED 'tdinamica'<br>
4 REPLIES 4

moshenaveh
Community Manager
Community Manager
0 Kudos
453

Welcome to the SAP Community. Thank you for visiting us to get answers to your questions.

Since you're asking a question here for the first time, I'd like to offer some friendly advice on how to get the most out of your community membership and experience.

First, please see https://community.sap.com/resources/questions-and-answers, as this resource page provides tips for preparing questions that draw responses from our members. Second, feel free to take our Q&A tutorial at https://developers.sap.com/tutorials/community-qa.html, as that will help you when submitting questions to the community.

I also recommend that you include a profile picture. By personalizing your profile, you encourage readers to respond: https://developers.sap.com/tutorials/community-profile.html.

Now for some specific suggestions on how you might improve your question:

* Outline what steps you took to find answers (and why they weren't helpful) -- so members don't make suggestions that you've already tried.

Should you wish, you can revise your question by selecting Actions, then Edit.

The more details you provide (in questions tagged correctly), the more likely it is that members will be able to respond.

I hope you find this advice useful, and we're happy to have you as part of SAP Community!

Sandra_Rossi
Active Contributor
0 Kudos
453

Your question re-formatted:

I need to convert a dynamic table to an internal one for the program to work, I leave the code below

I NEED TO CREATE AN INTERNAL TABLE WITH THE VALUES OF THE DYNAMIC ONE CALLED 'tdinamica'

PARAMETERS: tablaN TYPE dd02l-tabname.
DATA: btn_ok TYPE sy-ucomm.
DATA tdinamica TYPE REF TO DATA.
field-symbols: <fs>.
*VARIABLES ALV
DATA:

  it_fcat      TYPE STANDARD TABLE OF lvc_s_fcat, "CATALOGO DE CAMPOS DE ALV | COLUMNAS DEL ALV"
  vg_container TYPE REF TO cl_gui_custom_container, "OBJETO DEL CONTENEDOR"
  obj_alv_grid TYPE REF TO cl_gui_alv_grid. "MÉTODOS DE LA CLASE ESTANDAR DE ALV TIPO GRID"
CREATE DATA tdinamica TYPE (tablaN).
ASSIGN tdinamica TO <fs>.
*CLASE INTERNA
CLASS cls_alv01 DEFINITION DEFERRED.
DATA: obj_alv_01 TYPE REF TO cls_alv01.

Sandra_Rossi
Active Contributor
453

What about first changing few lines to this ? (you must indicate that it's a table, and you must use the DEREFERENCING operator ->* after create data, as you can find in many places in the Web)

field-symbols: <fs> TYPE STANDARD TABLE.
CREATE DATA tdinamica TYPE TABLE OF (tablaN).
ASSIGN tdinamica->* TO <fs>.

etc.

0 Kudos
453

It worked doing ->*, thank you so much !!!