cancel
Showing results for 
Search instead for 
Did you mean: 

how to add new field in sapscript

Former Member
0 Kudos

hi experts

can u please help me how to add fields in sap scripts provide steps plz.

Accepted Solutions (0)

Answers (5)

Answers (5)

Former Member
0 Kudos

Hai Ahmed,

We can add new field to the existing sapscript by copying the form to the zform(like Medruck to zmedruck) and using the concept of subroutine pool.This subroutine pool takes the help of ITCSY structutre which has the fields name and value.Pass the value to the subroutine pool from the form with reference to which you want the new field.If you want mtart field in medruck you pass it as

/: PERFORM GET_MATERIAL IN PROGRAM ZSD_MATERIAL

/: USING &VBAP-EMATN&

/: CHANGING &P_MATNR&

/: ENDPERFORM.

Then you create a subrouting pool with name ZSD_MATERIAL and in that declare a form with name GET_MATERIAL and writre a select querry to get the mtart field from mara table with reference to EMATN field of VBAP.

Hope this will solve your problem.

Ramesh.

Former Member
0 Kudos

to add a new field to the exising layout set you have to use subroutines and if you added a new window and have to out put some text on that from data base then copy the print program and the use write_form fm and pass text element to the write_form fm.

reward points if helpful.

Former Member
0 Kudos

we can add new field to sap script to meet the requirement of enduser. So we need to add the related text in form and then adding that field in the driver program.The data of the field should be retrieved from the database.

1.If we will add new field to SAP provided form like MEDRUCK then we we copy it to new form(Zf...)

2.Then we will add the text in the required place.

3.Then in the driver program we have to add that field .

If we have our own form then we can add through above steps.Here copy is not required.

Former Member
0 Kudos

Hi frnds..i also got this situation

but here we wrote the driver program and now i have to add extra field to script.But i dont have authorization to edit existing driver program.Without effecting drier program I want to add fiel to script.

Can anyone tell me how with syntax..

Thanks in advance

former_member552147
Participant
0 Kudos

Hi guys

Is there anyone solved it using subroutine solution (sapscript) which seems to be more sophisticated versus modification of standard printing program (SAPMF06P)?

Can you please post a template or example of your way out for this situation?

Thank you in advance,

Yutah

Former Member
0 Kudos

In sapscripts if you want to add new fields you have to declare it in the print or driver program and use it in the sapscript as program symbols.

For example if you want to a field like vbeln is added inthe sapscript then declare it in the print program like

data wa_vbak like vbak-vbeln.

Then in the sapscript add &WA_VBAK-VBELN& in the Editor

Former Member
0 Kudos

but print program nvere allow us to modify ! then how to add fields?

Former Member
0 Kudos

hi,

yes you're right. we can nver modify the standard print programs. however, you can copy the same in se38 with either z or y as the starting letter. After you've copied the print program such as SAPFM06P for Medruck to ZSAPFM06P, you can edit the program..i.e you can add ur own structure/fieldstring..and can use the same in printform's text editor as the program symbol.

I think this solves the issue.

thanks,

shamim.

Former Member
0 Kudos

Then we can easily modify !

but when i post the same query in past ,

some people have given me the concept of subroutine(perfom....itcsy...form..)

then y this concept? instead of this we can add directly using ur theory?

can u tellme with an example y this subroutine concept while talking abt adding fileds to scripts ?

Former Member
0 Kudos

Generally one print program will be used by many forms.so it is better to use subroutine rather than changing print program.

Regards,

Sai Prasad