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

Screen fields getting cleared on user Action in Module Pool

Former Member
0 Likes
7,408


Hi All,

I have created sub screen in standard transactions in one of the custom tab that we created. We created this tab next to additional tab B in order related transactions.

I have added few fields in the subscreen. The problem am facing here as soon i enter the value in the field and press enter the values are getting cleared.

When i try to save directly without pressing enter, system is saving the value in database but if i press enter again in the transaction the values are cleared.

I dont use any clear system in my code to effect this scenario.

Requesting your guidance on the same.

Regards

1 ACCEPTED SOLUTION
Read only

RaymondGiuseppi
Active Contributor
0 Likes
3,914

Did you use some TABLES statement on some structures or tables in global area (top include) to insure communication between program (variables) and dynpro (screen fields)?

Regards,

Raymond

17 REPLIES 17
Read only

siva_subramanian2
Participant
0 Likes
3,914

Hi Saranya,

Please check the below

  • If you select the field with reference to dictionary (ex: like VBAK-VBELN). The value won't disappear after pressing enter.
  • Define your screen name of the field, by data statement in your program.This will also help you.

Thanks

Siva.A

Read only

0 Likes
3,914

Hi Siva Subramanian,

Am using two fields from data dictionary and two fields i created.

Can you please help me on your second point, defining screen name. Can you help me with the syntax.

Read only

RaymondGiuseppi
Active Contributor
0 Likes
3,915

Did you use some TABLES statement on some structures or tables in global area (top include) to insure communication between program (variables) and dynpro (screen fields)?

Regards,

Raymond

Read only

0 Likes
3,914

Hi,

For fields that are not part of table fields, these fields i have created in screen using CHAR data type.

What changes should i do for these cases.

Regards

Read only

former_member185537
Participant
0 Likes
3,914

Hi Saranya,

Declare the input fields name in the global data of the program. Use the same as the field name for automatic data transfer from screen to program so that the data is available in the program after transfer of data from screen. Use tables statement for dictionary elements and data for other fields with same name as of the screen fields.

Read only

Former Member
0 Likes
3,914

Thanks Pras Venkat Raymond Giuseppi,

i have one scenario,

i have declared a field name as <G_EXP-YYADJTAT>, the same field i have used it my program and declared the same field in Top Include as field.

What should i do in this case to avoid clearing of the field after i press enter. Does the field symbol declaration is sufficient?

Please help me on this.

Let me try your suggestions and get back to you on the same.

Read only

former_member1716
Active Contributor
0 Likes
3,914

In your Screen painter under program tab do not forget to check the output field check box.

please check this first before you proceed with the solutions suggested by experts above.

Read only

Former Member
0 Likes
3,914

Thanks Pras Venkat Raymond Giuseppi,Satish Kumar Balasubramanian

With all your inputs am able to clear the issue for the all fields except the fields which i declared as a field symbol in the program and declared the same name in the screen as mentioned above.

Requesting your help and guidance for this one final field.

Regards

Read only

0 Likes
3,914

I'm not sure Abap is able to map screen fields to field symbols subscreen (never tried, what if not assigned?). In any case it should not be able to do this for ddic reference field as they require a TABLES statement (*)  Using some FIELD ... MODULE won't satisfy your requirement...

Regards,

Raymond

(*) Ref: dynpro fields

Read only

0 Likes
3,914

If the field symbol is not assigned, that would short dump GETWA_NOT_ASSIGNED exactly as for normal ABAP (I didn't know, so I tried it ).

I advise adding a watchpoint to the data object to which the field symbol is assigned, to identify when it's cleared out.

Read only

0 Likes
3,914

If that the field symbol is populated in a BAdI ... then it is possible that on each PBO a new instance of the real data field is created in this BAdI, then it would look like the field gets cleared. And in this case you would never see a GETWA_NOT_ASSIGNED

Read only

Ashg1402
Contributor
0 Likes
3,914

Hi,

did u try debugging it.? when ever u press enter it goes through a certain flow like PAI -> PBO -> PBO. Try debugging and then check the flow, also monitor the values of the field which u have declared.

One cause i can think is that there runs a select query for the fields to get output , whenever you are pressing enter that flow is getting triggered and hence there is no value in DB , its getting cleared. Can be other cause too.  Do one thing put value on screen fields give '/h' in command field and press enter and then continue with debugging.

Read only

Former Member
0 Likes
3,914

Hi Ashish,

There is no select query, i know that i need to declare the field using DATA keyword but in this case am declaring it as field symbol only then i can meet requirement.

There is some trick that needs to be followed when we are using the field symbol to avoid this auto clearing. Am just clueless on the same.

Requesting the guidance of the experts.

Read only

0 Likes
3,914

Can you paste the part of your code.?

Read only

Former Member
0 Likes
3,914

Hi,

cross check that you are not clearing your field symbols not in PBO and PAI of the screen.

For the screen fields, it does not matter whether you declare it as data or with field symbol,

the point is the name and data types should be same for the screen fields name as well as the program fields name.

Playing with the field symbols needs a bit of cautiousness because it plays with the memory and must be assigned before its used

Could you tell us how you are adding the extra tab .i.e. using BADI OR customer Exit?

If Customer Exit then try to use Memory ID (Import and Export).

Regards,

Syed

Read only

Former Member
0 Likes
3,914

there is no explicit code here. i have declared the fields symbols here as below,

FIELD-SYMBOLS:<g_exp-yyadjtat>       TYPE vbak-yyfield.

I have used the same field name <g_exp-yyadjtat> in the screen painter.

In later stage in one of the include am assigning some value to this field symbol.

I get the data getting stored in table successfully but on pressing enter the values are geting cleared.

Please help.

Read only

0 Likes
3,914

Hi, I think you simply forgot to assign a real field to your field-symbol ....