This website is not affiliated with, sponsored by, or approved by SAP AG.

Refresh Buffer in Smartforms

Development SAPscript/ Smartforms

Moderators: Snowy, thx4allthefish, YuriT, Gothmog

Refresh Buffer in Smartforms

Postby lokesh » Thu Jan 20, 2005 8:30 am

Hello All,

I am facing a problem in Invoice Smartform. I have to print multiple invoives at one go. Hence I am running the Smartform in a loop.
The problem is that the previous data is not refreshed and hence creates a problem.

Could anyone of you tell me how to Refresh the Smartform buffer.

Regards
Lokesh
lokesh
 

Postby Niteshshelar » Thu Jan 20, 2005 10:17 pm

Hello Lokesh,

The problem in your case is that ,
When you call smartforms again it contains previous data as it's top is defined only once in your calling program and then after it contains previous data.

Solution to this problem is
Create one more report which has only calling function modules of smart forms and then submit this report to your calling program. In this way each time you call smart form a totally new instance of it's top will be created as it is different run time enviroment and previously used instance will get lossed automatically and thus buffer will get refreshed.

Only problem you will face in this methode to how to pass data from one report to other , for this you have to use import and export to memory id.
To resolve performence issue free mermoy id immed. as it's purpose is finished.

Thanks,
Nitesh Shelar
Niteshshelar
 
Posts: 7
Joined: Thu Jan 20, 2005 9:55 pm
Location: Mumbai, India

Re: Refresh Buffer in Smartforms

Postby robson76 » Sat Jul 26, 2014 1:56 pm

Hi,

I realized, at least in my scenario, the issue is in the standard function LOAD_TEXT, called from Smart Form to read texts.

After the first time, internal table TEXT_HEADER keep with previous data, so the function does not get the new data from database.

I solved the issue with the following snippet. Maybe do not be the best way, but now it works.

FIELD-SYMBOLS:
<lfs_text_header> TYPE ANY TABLE.

ASSIGN ('(SAPLSTXG)TEXT_HEADER[]') TO <lfs_text_header>.
IF sy-subrc = 0.
REFRESH <lfs_text_header>.
ENDIF.

Robson
robson76
 
Posts: 1
Joined: Sat Jul 26, 2014 1:42 pm


Return to SAPscript/Smartforms

Who is online

Users browsing this forum: Yahoo [Bot] and 1 guest





This website is not affiliated with, sponsored by, or approved by SAP AG.