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: 

Demo_form Fly&Smile - what does the PrintProgram actually do?

Former Member
0 Kudos

Hi,

I have by chance found the form for that Fly&Smile-example that is in every SAP exercise. I have looked at the layout of that form and at the PrintProgram - well, both of them, there is that RSTXCDM1 and RSTXEXP1 - two different ones as it seems. I can execute both, but the latter one does not result in anything being printed and when I use the former one, selecting exactly that form, S_CA930_DEMO_1, then what I see on the printout is exactly what I see in the layout when I download it - there is seemingly nothing dynamic about that, so now I'm not sure, what is the PrintProgram actually doing in this case? And why are there two of them with a different "outer" name - and looking different - but with the same name in that "REPORT" command?

Can anybody explain to me where the info the report RSTXEXP1 selects from those tables comes in?

Thanks a lot!

Best regards,

Sapperdapper

1 ACCEPTED SOLUTION

Jelena
Active Contributor
0 Kudos

Tables such as SPFLI are used in SAP training classes and in demo programs. To fill them in with data, use transaction BC_DATA_GEN. Please use search / Google before posting.

Name in the REPORT command is probably because one program was copied from another and whoever did that forgot to change it. It's not changed automatically and it's not considered a syntax error (I'm not sure it even matters much - I've seen many programs with incorrect names and they all worked just fine).

9 REPLIES 9

Jelena
Active Contributor
0 Kudos

Tables such as SPFLI are used in SAP training classes and in demo programs. To fill them in with data, use transaction BC_DATA_GEN. Please use search / Google before posting.

Name in the REPORT command is probably because one program was copied from another and whoever did that forgot to change it. It's not changed automatically and it's not considered a syntax error (I'm not sure it even matters much - I've seen many programs with incorrect names and they all worked just fine).

Former Member
0 Kudos

Hi Jelena,

I know that this table is used in SAP training classes - I have come across it on the help.sap sites before.

I know doing a search is both asked for and usually a good idea - and I usually do so - only this time I was a bit shocked to find that, instead of having completed the currently required step of my program, I was short of being sacked. Still I have no time - well, I do have time, till Thursday, to come up with something. So excuse me for now, I will do so again next time.

The name in the REPORT - okay, that is not critical. I will also have a look at this BC_DATA_GEN. Only I still don't quite understand what the PrintProgram can actually do when all I see via that other REPORT - RSTXCDM1 - is in the (downloaded) form layout. Well, I'll see.

Thanks anyway!

Best regards,

Sapperdapper

Former Member
0 Kudos

Hello Friedrich,

   Report RSTXEXP1 fetch data from tables SCUSTOM, SBOOK and SPFLI based on customer number and Airline details entered on selection screen.

Go in SE38-> put a program name  RSTXEXP1 -> execute(F8)..

Then its open form S_EXAMPLE_1..write data on to layout based on layout (S_EXAMPLE_1) design.

Regards,

Deepti

Venkat_Sesha
Advisor
Advisor
0 Kudos

Hi Friedrich,

Good Day!. Here is the situation that explains your question. I have a Smartform or a SAP Script FORM. Now I have Offices in America, Germany, Swedan, Barcelona. Every body uses the same sever for doing the business. but the Person in the Spain doesnt want two fields to show in the FORM OUTPUT that is created. He want to hide those data instead of showing them to customer. But the Same FORM used in USA or Germany needs those two fields to show them to customer. In this case we choose Output types which will satisfy these kind of requirements. Each Output type will be assigned to the Transaction and in the Print Program we filter the data to be written on the output of the Form by filtering based on this condition. For this you can search more as mentioned below.

If you need to check the Output Type and the form name which is called by any Print program or Transaction. You can see in the program RSNAST00 at line number 875. Put a breakpoint here and execute the program by providing your OUTPUT Type in the Selection screen. So from there it will go to the exact Print program for the related Output type which is configured in NACE Table TNAPR.

If you have two print programs for the same Output type or One Print program for two different Output types this the way where you can easily reach to the conditions and do some analysis why they were done like that or so?

Hope this helps.

0 Kudos

Hi Venkat,

I understand - and I do not 😉 I do understand that one form can look slightly different and that is configured via the output_type to save the users the hazzle of creating three near identical forms. I know Tcode NACE and the table TNAPR which shows up in that Tcode.

P.S.: Ah - the form that's in the parameters of OPEN_FORM in that PrintProgram is not the same as that Fly&Smile-example I was looking at - it is this S_EXAMPLE_1, not that S_CA930_DEMO_1. That was what was confusing me. When I execute that program, I do see that it seems to be dependent on the data I enter. It looks good - simple and clearly structured so I should be able to get my program to work on that. I'll see what is there to see and I'll try downloading the layout as a txt - which is part of my program currently - and have a look at it.

Thanks for helping!

Best regards,

Sapperdapper

0 Kudos

Hi Friedrich,

That could be because if you dont have entries in the table BOOKINGS, you dont see any data shown up in the FORM Output. Try to enter the below mentioned selection Criteria then hope this clears your doubt .

Customer Number 1 to 10

Carrier AA to UA then execute you see the result.

Hope this helps.

0 Kudos

Hi Venkat,

yes, that clarifies. Strange, when I execute the PrintProgram, I do get data, but no booking_number - there also isn't any space apparently reserved for it, the form seems pretty complete - but when I look at that table BOOKINGS in the data browser, it appears to be empty.

Also, when I enter your criteria instead of the default (just one cust_nr, just LH), I get some more data, but nothing different.

What's even stranger, SAP tells me that form is not available in client 800, only in 000 - but I can get a printout of the form only in client 800, not in 000 - there I can fill out the selection criteria, click >Execute< - but nothing happens.

Well, be that as it may - when I can display the original "SAP-style" form (which I can do, albeit not quite logically) and I can use my code to get the necessary data from those tables, that will be enough for the moment. It would be nice to understand why this is so, but right now I think it is not strictly necessary.

P.S.: Well, following the logic of using info from DD05P to link the tables, I need SBOOK for SCUSTOM and SPFLI seem to be linked only via SBOOK. So I will probably have to put some data in there anyway. Perhaps that will also clear up that other mystery. I guess, since that example is used throughout the SAP exercises, there must be something on how to fill that with suitable data. I will have a look.

P.P.S.: That table, SBOOK - sry, BOOKINGS is the internal table - is that filled in your systems or is it empty? I cannot quite get over the fact that in the DataBrowser it appears empty and in the layout (downloaded as a txt), there is no hard-coded data, but variables from that very table, so there should not be any data when the table is empty - but I can execute the PrintProgram and I have some proper data.

P.P.P.S.: OK, that mystery is solved - the table SBOOK is well filled in client 800, but not in client 000 - I must admit I didn't know that was possible... the form, instead is only in 000 - so I must now transport either the table or the form.

Jelena
Active Contributor
0 Kudos

Unlike Smartforms, SAPScript forms are client-dependent. Data in the tables with MANDT field is also client-dependent.

Not sure though why are you investing so much effort into investigating these demo forms. If you have a specific assignment, then just use demo as a sample for your own code. Print program just reads the data and passes it to the form. Form is just the layout to output that data. Not a rocket science...

Former Member
0 Kudos

Hi Jelena,

well, right now I have to, I need to have something to show my concept works - which it does, in principle - on one of the forms by default available in our system, and that Fly&Smile-example happens to be an apparently good choice - it is such that my current code works using that and since I don't have the time to enhance my code, I'm using a form that fits what I currently have.

I guess it all would have been a bit easier had I started using the PrintProgram instead of the layout from the start, but that will be my next step. Right now, I'm only concerned about getting the chance to take that step. That is why I'm trying to get that demo_form to work.

Best regards,

Sapperdapper