Anda di halaman 1dari 5

3/19/2018 Dynamic table in smartforms?

(http://w
ww.sap.c
Products
om/) (https://www.sap.com/products.html)

Industries (https://www.sap.com/industries.html)
Support Support (https://www.sap.com/support.html)

Training (https://www.sap.com/training-certi cation.html)

Community (https://www.sap.com/community.html)

Developer Partner
(https://www.sap.com/developer.html) Partner (https://www.sap.com/partner.html)

About (https://www.sap.com/corporate/en.html)

 
Home (https://www.sap.com) / Community (https://www.sap.com/community.html) / Archives (/) / Discussions + Actions
Archive (/discussions) / ABAP Development (/discussions/space/abap)

Archived discussions are read-only. Learn more about SAP Q&A


(https://go.sap.com/community/about/questions-and-answers.html)

Dynamic table in smartforms?


This question is answered

Hi All,

I have created a dynamic table in driver program and filled the data.

But in the form designing, how to declare the dynamic tables?

Kindly assist.

Regards,

https://archive.sap.com/discussions/thread/3704669 1/5
3/19/2018 Dynamic table in smartforms?

Aj...

(https://people.sap.com/ajaykumar.vangari)

ABCD EFGH (https://people.sap.com/ajaykumar.vangari)


February 27, 2015 at 12:57 PM
0 Likes

Correct Answer

(https://people.sap.com/rajkumarnarasimman)

Rajkumar Narasimman (https://people.sap.com/rajkumarnarasimman) replied February 27, 2015 at 12:57 PM

Hi Ajay,

Dynamic internal table, we can use in driver program, We can move the internal table value from
driver program to smartform in the following way.

Using ABAP Memory


, Using Structure

1. Using ABAP Memory we can move it.


1. Using IMPORT/EXPORT Statement, we can move the internal table, at the end we are
suppose to show the value in the smartform table. In there, we have to mention the
variable name in textfield (i.e. &FIELD1&) to show the value in the smartform.

2. , Using Tables section in Smartform, we can move it.

In order to create the structure, it is required to create the structure in SE11.

Convert the Dynamic internal table to static internal table. Create the structure in SE11, use the same
https://archive.sap.com/discussions/thread/3704669 2/5
3/19/2018 Dynamic table in smartforms?

structure in both driver program and smartform and move the values to smartform.

"Run the Loop

LOOP AT <dyn_table> INTO <fs_line>.

"Assign the value

ASSIGN COMPONENT 'BWART' OF STRUCTURE <fs_line> TO <fs_value>.

"Check value is initialized

IF <fs_value> IS ASSIGNED.

"Assign to final work area

WA_FINAL-BWART = <FS_value>.

ENDIF.

"Append final internal table

APPEND WA_FINAL TO IT_FINAL.

"Clear WA

CLEAR WA_FINAL.

ENDLOOP.

I hope at the end, in both the cases, we are suppose to mention the structure field name in table text-
field as shown in above screenshot. I recommend to create the structure and convert dynamic internal
table to static internal table using the above code.

Regards

Rajkumar Narasimman

1
View this answer in context (/discussions/message/15784103#15784103)

oking for? View more on this topic (https://go.sap.com/community/tag.html?


8661924709785639136) or

tps://answers.sap.com/questions/ask.html?primaryTagId=833755570260738661924709785639136)

1 replies

Correct Answer

https://archive.sap.com/discussions/thread/3704669 3/5
3/19/2018 Dynamic table in smartforms?

(https://people.sap.com/rajkumarnarasimman)

Rajkumar Narasimman (https://people.sap.com/rajkumarnarasimman)replied

February 27, 2015 at 13:01 PM


Hi Ajay,

Dynamic internal table, we can use in driver program, We can


move the internal table value from driver program to smartform
in the following way.

Using ABAP Memory


Using Structure

1. Using ABAP Memory we can move it.


1. Using IMPORT/EXPORT Statement, we can move
the internal table, at the end we are suppose to
show the value in the smartform table. In there, we
have to mention the variable name in textfield (i.e.
&FIELD1&) to show the value in the smartform.

2. Using Tables section in Smartform, we can move it.

In order to create the structure, it is required to create the


structure in SE11.

Convert the Dynamic internal table to static internal table.


Create the structure in SE11, use the same structure in both
driver program and smartform and move the values to
smartform.

https://archive.sap.com/discussions/thread/3704669 4/5
3/19/2018 Dynamic table in smartforms?

"Run the Loop

LOOP AT <dyn_table> INTO <fs_line>.

"Assign the value

ASSIGN COMPONENT 'BWART' OF STRUCTURE


<fs_line> TO <fs_value>.

"Check value is initialized

IF <fs_value> IS ASSIGNED.

"Assign to final work area

WA_FINAL-BWART = <FS_value>.

ENDIF.

"Append final internal table

APPEND WA_FINAL TO IT_FINAL.

"Clear WA

CLEAR WA_FINAL.

ENDLOOP.

I hope at the end, in both the cases, we are suppose to


mention the structure field name in table text-field as shown in
above screenshot. I recommend to create the structure and
convert dynamic internal table to static internal table using the
above code.

Regards

Rajkumar Narasimman

Share & Follow


(https://www.facebook.com/sapcommunity) (https://twitter.com/SAPCommunity)
(https://www.youtube.com/c/SAPCommunities) (https://www.linkedin.com/company/sap)
(https://plus.google.com/+SAPCommunities) (https://instagram.com/sap/) (http://www.slideshare.net/SAP)

Privacy (http://go.sap.com/about/legal/privacy.html) Terms of Use (http://go.sap.com/corporate/en/legal/terms-of-use.html)


Legal Disclosure (http://go.sap.com/about/legal/impressum.html) Copyright (http://go.sap.com/about/legal/copyright.html)
Trademark (http://go.sap.com/about/legal/trademark.html) Sitemap (http://www.sap.com/sitemap/index.html) Newsletter
(https://go.sap.com/registration/newsletter.html)

https://archive.sap.com/discussions/thread/3704669 5/5

Anda mungkin juga menyukai