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

how to free SAP Memory (Set parameter) for push button

Former Member
0 Likes
4,080

Dear All,

      Could anybody  please tell me ,How to free SAP memory for below scenario?

Scenario.

I have created one custom Tab screen including 6 customized fields in Tcode: BP as inside BP there are 3 push buttons for creating business partner (like Person, Organisation and Group) ,

I'm passing the parameters values from BADI to customize screen(PBO) using set parameter and getting parameters values for those customized fields using SAP memory parameters for business partner (After clicking on person)

But after saving business partner person when I'm trying to create business partner (Organisation click on org push button) at that time old values persist under customize tab .

Here ,I want to ask , how to free sap  memory after saving records for one option like(person) and old value should't display when I create organisation.

Please  find more datails as an attachment and give me reply asap  that would be helpful.

Regards,

Alok

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
3,424

Try this.

Suppose zorg is your organization field and 'ORG' the parameter ID.

data: zorg type org.

* after getting values from ID

clear zorg.

set parameter ID 'ORG' field zorg.

Another option

DATA PERNR_C TYPE STRING.

SET PARAMETER ID ’PERNR’ FIELD PERNR_C

GET PARAMETER ID ’PERNR_C field pernr_C.

FREE MEMORY ID  ’ PERNR_C’.

OR

DELETE FROM MEMORY ID  ’PERNR_C’

OR

SET PARAMETER ID  ’PERNR_C’ FIELD SPACE

Try this.

Suppose zorg is your organization field and 'ORG' the parameter ID.

data: zorg type org.

* after getting values from ID

clear zorg.

set parameter ID 'ORG' field zorg.

Another option

DATA PERNR_C TYPE STRING.

SET PARAMETER ID ’PERNR’ FIELD PERNR_C

GET PARAMETER ID ’PERNR_C field pernr_C.

FREE MEMORY ID  ’ PERNR_C’.

OR

DELETE FROM MEMORY ID  ’PERNR_C’

OR

SET PARAMETER ID  ’PERNR_C’ FIELD SPACE

12 REPLIES 12
Read only

Former Member
0 Likes
3,425

Try this.

Suppose zorg is your organization field and 'ORG' the parameter ID.

data: zorg type org.

* after getting values from ID

clear zorg.

set parameter ID 'ORG' field zorg.

Another option

DATA PERNR_C TYPE STRING.

SET PARAMETER ID ’PERNR’ FIELD PERNR_C

GET PARAMETER ID ’PERNR_C field pernr_C.

FREE MEMORY ID  ’ PERNR_C’.

OR

DELETE FROM MEMORY ID  ’PERNR_C’

OR

SET PARAMETER ID  ’PERNR_C’ FIELD SPACE

Read only

VijayaKrishnaG
Active Contributor
0 Likes
3,424

Hi Alok,

You can SET PARAMETER ID as SPACE for fields or parameter that effects, in PAI for every push button. That means initially you set parameter ID as Space and then write your business logic for each push button.

Thanks & Regards,

-Vijay

Read only

former_member206479
Participant
0 Likes
3,424

Hi Alok,

We can make use of FREE key word. Please looking Free Keyword documentation.

Regards,

Venkat.

Read only

0 Likes
3,424

Hi venkat ,

  I've used free keyword but it's not working  and but we use tcode ; bug2 and come back to BP screen again at that time I see , data is not present in customize screen so what is the cause , sometimes memory free and sometimes for new option it shows old values from buffer .

Read only

0 Likes
3,424

Hi,

Please try below code and let me know.

DELETE FROM SHARED MEMORY indx(pt)  ID 'ZMID'  - or

DELETE FROM SHARED BUFFER indx(pt)  ID 'ZMID'.

Best Regards,

Abirami

Read only

0 Likes
3,424

Hi Abirami,

  Still, It's not working .As I'm able to create business partner (person) and save then after I go for organisation (click on push button) again  I see old values under customized tab in SAP transaction BP.

Regards,

Alok

Read only

RaymondGiuseppi
Active Contributor
0 Likes
3,424

As already written you have to clear memory with FREE or SET to space. But not only your own memory id (the one exported in BAdI) but also the standard memory ids used by BP transaction  (BPA, etc.) Also insure that your custom code for custom tab manages correctly the GET MEMORY ID, and clear/refresh data if the GET MEMORY fails.

Regards,

Rayond

Read only

0 Likes
3,424

Hi Sushmitha/Raymond,

   

   Earlier I've used free or space memory in our program but it was not working that's I had asked that how can we free memory after saving record .

regards,

alok

Read only

0 Likes
3,424

Hi Alok,

Please let me know at which block you are trying to get the paramter id.

If you have used 'get parameter id' at initialization, just remove it and try  placing 'get paramter id' in AT SELECTION-SCREEN output.

For Ex:

PARAMETERS: P_EBELN LIKE EKKO-EBELN MEMORY ID EBS. 

AT SELECTION-SCREEN OUTPUT.

  GET PARAMETER ID 'BES' FIELD P_EBELN.

START-OF-SELECTION.
  P_EBELN = P_EBELN + 1.
  SET PARAMETER ID 'EBS' FIELD P_EBELN.
  WRITE: / P_EBELN.

Best Regards,

Abirami

Read only

0 Likes
3,424

HI Abirami ,

  I'm passing parameter from one  ADDRESS badi to Screen exit for customize scree BP .

Please find below code on this.

Read only

0 Likes
3,424

Hi,

Did u try SET PARAMETER ID 'LAT' FIELD SPACE.

It helps to delete SAP memory ID.

Best Regards,

Abirami

Read only

0 Likes
3,424

Hi ,

Yes ,I had also used SET PARAMETER ID 'LAT' FIELD SPACE. but it did't work.

Regards,

Alok