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: 

Custom Field Update in VBAK table

Former Member
0 Kudos


Hi All,

I have added two custom fields from VBAK table into the below screen details of transaction VA22 in Additional data tab B,

Program Name: SAPLXCN1

Screen number: 9120

One small logic here is these fields are inside a custom tab of a tabstrip. Am not able to update the standard table VBAK also the values that are entered in Transaction VA22 is not appearing if i go into the T-code again.

Kindly help me in updating the database.

Regards

9 REPLIES 9

chabbi_mustapha
Explorer
0 Kudos

Hello,

You need to move you data from the specific structure in you screen to the standard vbap structure ( In PAI Module) by calling structure from your specfic screen (ZXXX) lv_field

then all insertion/modification is done by the standard program,

Regards,

0 Kudos

Could you please help me with more info. An eg with a piece of code would be better for me, as am new ABAP finding it quite difficult in achieving the same.

0 Kudos

chabbi_mustapha
Explorer
0 Kudos

Hello,

Ok , No problem,

In the code bellow:

We read data from different screen in Additional data B ( here there in a specific program ZSAPMV45A and the we put them in the standard sructure in of VBAP.

  • First we need to get data from the the specific structure
  • And the we assing them in local to structure then put values in VBAP structure

*********

DATA :

         lc_vbap          TYPE c VALUE '(ZSAPMV45A)VBAP'            LENGTH 15,

         lc_ctseed_field  TYPE c VALUE '(ZSAPMV45A)GT_CTSEED_FLD_GLB'  LENGTH 28,

         lc_del_tab       TYPE c VALUE '(ZSAPMV45A)GT_DEL_TAB'       LENGTH 21,

         lc_currentfldnum TYPE c VALUE '(ZSAPMV45A)GV_CURRENTFLDNUM' LENGTH 27,

         lc_ctcrop        TYPE c VALUE '(ZSAPMV45A)GT_CTCROP_GBL'    LENGTH 25," for screen 9203 program ZSAPMV45A.

         lc_del_crop      TYPE c VALUE '(ZSAPMV45A)GT_CTCROP_DEL'    LENGTH 25,

         lc_ctdispatch    TYPE c VALUE '(ZSAPMV45A)GT_CTDISPATCH_GBL' LENGTH 28," for screen 9204  program ZSAPMV45A.

         lc_del_dispatch  TYPE c VALUE '(ZSAPMV45A)GT_CTDISPATCH_DEL' LENGTH 28." for screen 9204  program ZSAPMV45A.

* Field-symbols

  FIELD-SYMBOLS : <ls_vbap> TYPE vbap.

  ASSIGN (lc_vbap)          TO <ls_vbap>.

* Assign the table control cropcontrol screen 9203 program ZSAPMV45A.

  ASSIGN (lc_ctcrop)        TO <gt_ctcrop>.

  ASSIGN (lc_del_crop)      TO <gt_ctcrop_del>.

  Assign the table control dispatch screen 9204 program ZSAPMV45A.

  ASSIGN (lc_ctdispatch)   TO <gt_ctdispatch>.

  ASSIGN (lc_del_dispatch) TO <gt_ctdispatch_del>.

  ASSIGN (lc_ctseed_field)  TO <gt_ctseed_field>.

  ASSIGN (lc_del_tab)       TO <gt_del_tab>.

  ASSIGN (lc_currentfldnum) TO <gv_currentfldnum>.

  MOVE <gt_ctseed_field>    TO gt_ctseed_field.

  MOVE <gt_del_tab>         TO gt_del_tab.

  MOVE <gv_currentfldnum>   TO gv_currentfldnum.

* Save transport term code loaded from screen 9212 in ZSAPMV45A program

  vbap-zztrans_term   = <ls_vbap>-zztrans_term.

* Save scoring result loaded from screen 9202 in ZSAPMV45A program

  vbap-zzscorslt      = <ls_vbap>-zzscorslt.

  vbap-zzseednature   = <ls_vbap>-zzseednature.

* Save data which are loaded from screen 9207 in program ZSAPMV45A program

  vbap-zzbusc         = <ls_vbap>-zzbusc.

Remark : in your case you need to change vbak standard structure.

Hope this will be useful,

Regards,

Mustapha

0 Kudos

Hi,

Am autually passing the value to XVBAK Structure and values are also getting passed properly but still i find the data base is not updates.

0 Kudos

Ok Ok ,

I think that you put your code in the wrong place, ( In execution Logic of dynpro : 1 PBO ,2 PAI , then 3 PBO)

Perhaps in debug mode you see that all variables are OK in PAI module but you miss that values are cleared in PBO )

Verify you PBO in debug mode ,

Regards,

0 Kudos

Hi ,

I checked values are all there in the VBAK structure.

My question is once i pass the value to XVBAK, wont it update the table directly?

If not what is the step am missing here, should i commit somewhere or just passing the values in the xvbak is enough?

chabbi_mustapha
Explorer
0 Kudos

Generaly when you use xvbak it doesn't need any commit action ,the question here if you're using a screen exit, or a specific screen, i think you need to check the user exit of your program also it's maybe due to clearing of the structure.

0 Kudos

for additional tab-B  to update the custom fields use program name sapmv45A and screen number  8309  use PAI and PBO.