Application Development and Automation 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: 
Read only

Smart Forms and Inner Join

former_member207873
Participant
0 Likes
1,449

Hi Experts,

I am developing an SAP Smart Form. I have got two windows. One is secondary and one is main. There is one value in the secondary window based on

which I have to display the table of values in the main window. In the main window I am taking some values of the primary window plus some other fields from another table. Is there any problem in using the inner join statement? One of my seniors advised me to use TABLE FOR ALL ENTRIES IN instead of JOIN statement.

Regards,

Marina.

1 ACCEPTED SOLUTION
Read only

Jelena_Perfiljeva
Active Contributor
0 Likes
1,237

I can only guess that there is already an internal table passed to the form by the interface from the print / driver / <whatever we call it> program. If the requirement is to read, say, additonal data for the entries in that internal table then, naturally, FOR ALL ENTRIES would need to be used.

Overall it's difficult to comment on the subject intelligently since the requirements are not clear.

9 REPLIES 9
Read only

arindam_m
Active Contributor
0 Likes
1,236

Hi,

There is no problem using Joins, but its up to you and what your coding practices are in the project.

Cheers,
Arindam

Read only

0 Likes
1,236

Hi Arindam,

Thanks for your reply. Have you ever used join statements in your smart forms. Coding wise I find it as more easy than TABLE FOR ALL ENTRIES IN. But I do not know why my seniors say not to use join in smart forms.

Regards,

Marina.

Read only

arindam_m
Active Contributor
0 Likes
1,236

Hi,

Yes I have. But would be better to do all your processing in the driver program as then pass the required subset via tables in the global interface as smartform gets generated each time it avoids the situation where the generation take take longer due to too much processing logic in it.

Cheers,

Arindam

Read only

0 Likes
1,236

Hi Arindam,

I am relatively new to smart forms. It would be great if you could send one well structured custom smart form with driver program

Thanks in advance,

Marina.

Read only

arindam_m
Active Contributor
0 Likes
1,236

Hi,

I would like too. But I have to see the Functional Specs.   Its not like we can build Smartforms in a generic way like templates. I would suggest you to go through the sites like saptutorial to learn the basic elements that makes a smartform and you will also find loads of programs that can show how it it called in programs. As for all your queries do keep posting them here and people will get back to you with all the help.

Cheers,

Arindam

Read only

matt
Active Contributor
0 Likes
1,236

Coding wise I find it as more easy than TABLE FOR ALL ENTRIES IN. But I do not know why my seniors say not to use join in smart forms.

Regards,

Marina.

The most likely reason is that they are believers in the myth that FOR ALL ENTRIES is better than INNER JOIN. I don't know why that myth arose, but it seems to be embedded in the minds of people who may have plenty of experience, but have never got around to writing test programs to see if what they believe is really true.

In short: INNER JOIN is better in most cases than FOR ALL ENTRIES. Anyone who says otherwise is misinformed.

As far as ABAP and smartforms is concerned, but as little ABAP coding as possible within the form. In mine, I generally create a class which does all the gathering and computing, and in the form instantiate a instance of the class, and use methods to get the data - but put the actual processing in the body of the class.

Read only

arindam_m
Active Contributor
0 Likes
1,236

next time you should start with... here we go again before addressing the myth.

Cheers,

Arindam

Read only

RaymondGiuseppi
Active Contributor
0 Likes
1,236

It depends on actual requirement, are you supposed to print header records (first table) without matching records in item table (second table) ? If yes, don't use an [INNER] JOIN but a LEFT [OUTER] JOIN.


Else for performance, read For All Entries is NOT better than INNER JOIN in most cases (Author

Read only

Jelena_Perfiljeva
Active Contributor
0 Likes
1,238

I can only guess that there is already an internal table passed to the form by the interface from the print / driver / <whatever we call it> program. If the requirement is to read, say, additonal data for the entries in that internal table then, naturally, FOR ALL ENTRIES would need to be used.

Overall it's difficult to comment on the subject intelligently since the requirements are not clear.