2014 Nov 03 9:56 AM
Hi i got the requirement which is standard script medruck in which i have to add new 2 additional fields fo this i should use external subroutine as for requirement i developed subroutine which is working correctly but i am not getting values into changing parameters and also what value i need to pass as input parameter how can i get it from program or from me21 tcode
2014 Nov 03 10:02 AM
HI Srinivas,
Can you share your Perform written in Program and SAP script?
You can put break point in subroutine and can test it.
Thanks.
2014 Nov 03 10:18 AM
2014 Nov 03 10:29 AM
2014 Nov 03 10:14 AM
Do you want he new columns in the standard Medruck form?
From which form is the external subroutine called from?
2014 Nov 03 10:22 AM
2014 Nov 03 11:08 AM
Can you post the screenshot of the subroutine call made in the form.
2014 Nov 03 5:14 PM
2014 Nov 04 3:44 AM
HI,
Not able to open Zip file , Please attach or paste it again if possible
2014 Nov 04 4:16 AM
Hi,
I think you are not printing the text in the script, check this once...
-Srikanth
2014 Nov 04 8:44 AM
Hi,
try with this
Note:
Italian is the language of the comments. if you want you can translate these texts.
program zdati . (tipo programma: subroutines).
*---------------------------------------------------------------------*
* FORM datifooter *
*---------------------------------------------------------------------*
* ........ *
*---------------------------------------------------------------------*
* --> TAB_IN *
* --> TAB_OUT *
*---------------------------------------------------------------------*
form datifooter tables tab_in structure itcsy ---> all'interno sono contenuti i valori in using nel sapscript
tab_out structure itcsy. ---> all'interno sono contenuti i valori in changing nel sapscript
ALL'INTERNO DI QUESTA ROUTINE SI POSSONO FARE TUTTE LE OPERAZIONI.
L'IMPORTANTE è UTILIZZARE LE TABLES INDICATE ...
ALL'INTERNO DI ESSE CI SONO I DATI PASSATI ALLA CHIAMATA DELLA ROUTINE.
ESEMPIO:
data: ap_bukrs like t001-bukrs,
va_gruppo(35) type c,
va_cor(50) type c,
va_soc(25) type c,
va_gsber(5) type c,
va_denom(40) type c.
clear: ap_bukrs,
va_gruppo,
va_cor.
* lettura del campo società dalla tabin
read table tab_in with key 'T001-BUKRS'.
check sy-subrc = 0.
ap_bukrs = tab_in-value.
* Lettura per gruppo appartenenza
clear t001z.
select single paval into va_gruppo from t001z
where bukrs = ap_bukrs
and party = 'SAP023'.
if sy-subrc = 0.
* Gruppo appartenenza in tab_out
read table tab_out with key 'GRUPPO'.
check sy-subrc = 0.
tab_out-value = va_gruppo.
modify tab_out index sy-tabix.
endif.
* Lettura per Denominazione
clear t001z.
select single paval into va_cor from t001z
where bukrs = ap_bukrs
and party = 'SAP024'.
if sy-subrc = 0.
* Gruppo appartenenza in tab_out
read table tab_out with key 'COR'.
check sy-subrc = 0.
tab_out-value = va_cor.
modify tab_out index sy-tabix.
endif.
endform. "DATIFOOTER
*---------------------------------------------------------------------*
* FORM datifooter *
*---------------------------------------------------------------------*
* ........ *
*---------------------------------------------------------------------*
* --> TAB_IN *
* --> TAB_OUT *
*---------------------------------------------------------------------*
form datifooter2 tables tab_in structure itcsy
tab_out structure itcsy.
data: ap_bukrs like t001-bukrs, "società
va_gruppo(35) type c, "registro imposte
va_nome(35) type c,
va_via(50) type c,
va_cor(50) type c,
va_soc(25) type c,
va_gsber(5) type c,
va_denom(40) type c,
va_cs(25) type c,
va_codfi(20) type c,
va_codrea(20) type c.
clear: ap_bukrs,
va_gruppo,
va_nome,
va_via,
va_cor,
va_soc,
va_gsber,
va_denom,
va_cs,
va_codfi,
va_codrea.
* lettura del campo società dalla tabin
read table tab_in with key 'REGUH-ZBUKR'.
check sy-subrc = 0.
ap_bukrs = tab_in-value.
* Lettura per Nome Società
clear t001z.
select single paval into va_nome from t001z
where bukrs = ap_bukrs
and party = 'SAPI11'.
if sy-subrc = 0.
* Gruppo appartenenza in tab_out
read table tab_out with key 'NAME1-SOC'.
check sy-subrc = 0.
tab_out-value = va_nome.
modify tab_out index sy-tabix.
endif.
* Lettura per gruppo appartenenza
clear t001z.
select single paval into va_gruppo from t001z
where bukrs = ap_bukrs
and party = 'SAP023'.
if sy-subrc = 0.
* Gruppo appartenenza in tab_out
read table tab_out with key 'GRUPPO'.
check sy-subrc = 0.
tab_out-value = va_gruppo.
modify tab_out index sy-tabix.
endif.
* Lettura per Denominazione
clear t001z.
select single paval into va_cor from t001z
where bukrs = ap_bukrs
and party = 'SAP024'.
if sy-subrc = 0.
* Gruppo appartenenza in tab_out
read table tab_out with key 'COR'.
check sy-subrc = 0.
tab_out-value = va_cor.
modify tab_out index sy-tabix.
endif.
* Lettura per Capitale Sociale
clear t001z.
select single paval into va_cs from t001z
where bukrs = ap_bukrs
and party = 'SAP011'.
if sy-subrc = 0.
* Gruppo appartenenza in tab_out
read table tab_out with key 'CAP-SOC'.
check sy-subrc = 0.
tab_out-value = va_cs.
modify tab_out index sy-tabix.
endif.
* Lettura per Cod.Fiscale/P.IVA
clear t001z.
select single paval into va_codfi from t001z
where bukrs = ap_bukrs
and party = 'SAP013'.
if sy-subrc = 0.
* Gruppo appartenenza in tab_out
read table tab_out with key 'VA_CODFI'.
check sy-subrc = 0.
tab_out-value = va_codfi.
modify tab_out index sy-tabix.
endif.
* Lettura per REA
clear t001z.
select single paval into va_codrea from t001z
where bukrs = ap_bukrs
and party = 'SAP012'.
if sy-subrc = 0.
* Gruppo appartenenza in tab_out
read table tab_out with key 'VA_CODREA'.
check sy-subrc = 0.
tab_out-value = va_codrea.
modify tab_out index sy-tabix.
endif.
* Lettura per Indirizzo
clear t001z.
select single paval into va_via from t001z
where bukrs = ap_bukrs
and party = 'SAP016'.
if sy-subrc = 0.
* Gruppo appartenenza in tab_out
read table tab_out with key 'VA_VIA'.
check sy-subrc = 0.
tab_out-value = va_via.
modify tab_out index sy-tabix.
endif.
endform. "DATIFOOTER2
let me know,
AI