API Consumption - JSON Format

January 13, 2019 | Author: pandu M | Category: N/A
Share Embed Donate


Short Description

API Consumption - JSON Format...

Description

ZEWB_GEN_UDPATE_MODE

FUNCTION zewb_gen_udpate_mode . *"---------------------------------------------------------------------*"*"Update Function Module: *" *"*"Local Interface: *" TABLES  *" GT_VB! STUTUE VB!  *" GT_VB# STUTUE VB#  *" GT_#$MV STUTUE #$%V  *"---------------------------------------------------------------------*

                                   

   

                 

*e&a' Bill Generation ode( DATA:gt_return TYPE TABE OF bap!return". DATA: bap!return". DATA: DATA : ")t_+r, T!E TABLE $F +r,. g#_$br% TYPE $br%& $br%& gt_'eader TYPE TABE OF zewb_!n$& zewb_!n$& gt_'eader" TYPE TABE OF zewb_!n$& zewb_!n$& g#_'eader TYPE zewb_!n$& zewb_!n$& g#_re( TYPE zewb_re(& zewb_re(& g#_'eader" TYPE zewb_!n$& zewb_!n$& )$_*#on_+'ar TYPE tb,_#tr!ng& tb,_#tr!ng& to%en_me##ageto%en_me##age-" "/& /& )$_pa0)oad TYPE #tr!ng& #tr!ng& *#on_out TYPE #tr!ng& #tr!ng& )$_pa0)oad_, TYPE ,#tr!ng& ,#tr!ng& )$_re#pon#e TYPE tb,_#tr!ng& tb,_#tr!ng& to%en TYPE tb,_#tr!ng& tb,_#tr!ng& re(ue#t!dre(ue#t!d-" "/& /& gt_!tem TYPE TABE OF zewb_!n$!tem& zewb_!n$!tem & g#_!tem TYPE zewb_!n$!tem& zewb_!n$!tem& g#_!tem" TYPE zewb_!n$!tem& zewb_!n$!tem& gt_!tem" TYPE TABE OF zewb_!n$!tem. zewb_!n$!tem . DATA: DATA : !t_!n$ TYPE zewb_#tr_!n$ OCCU12  3IT4 4EADE1 INE. INE. DATA: DATA : )$_5g#t!n TYPE zz5g#t!n. zz5g#t!n . DATA: DATA : !tem)!#t TYPE zewb_#tr_!n$!tem OCCU12  3IT4 4EADE1 INE. INE. DATA: DATA : BE6IN OF !t_error& !t_error& error TYPE #tr!ng& #tr!ng & error_de#+r!pt!on TYPE #tr!ng& #tr!ng & END OF !t_error. !t_error. DATA: DATA : BE6IN OF !t_a)$ OCCU12 & do+no TYPE $br%7 $br%7$be)n& $be)n& ewbno TYPE zzewbno& zzewbno& ewbdtewbdt-8 8/& /& !+on TYPE +'ar9& +'ar9& bu%r# TYPE bu%r#& bu%r#& tt0pett0pe-" "/& /& dme##agedme##age-" "/& /& "Inoice /ata Validit' Me00a)e d$a)!dd$a)!d-"/& "Inoice /ata Valid or not #tatu##tatu#-" "/& /& $a)!d5rom$a)!d5rom-8 8/& /&

       

tmodetmode-" "/& /& $a)!dto$a)!dto-8 8/& /& tdo+date TYPE #07 #07datum& datum& 5!e)d_#t0)e TYPE )$+_t_#t0)& )$+_t_#t0) & me##ageme##age -" "/. /. DATA: DATA : END OF !t_a)$. !t_a)$.

DATA: DATA : BE6IN OF re#u)t& re#u)t&   ewa0b!))date TYPE #tr!ng& #tr!ng&   ewa0b!))no TYPE #tr!ng& #tr!ng&   $a)!dupto TYPE #tr!ng& #tr!ng& END OF re#u)t. re#u)t. DATA: DATA : BE6IN OF !t_re#u)t& !t_re#u)t&   #u++e## TYPE #tr!ng& #tr!ng &   re#u)t IE re#u)t& re#u)t & me##age TYPE #tr!ng& #tr!ng & END OF !t_re#u)t. !t_re#u)t. 1EAD TABE gt_$br% INTO g#_$br% INDE; ". *LV_VBEL% 1 GS_VB#-VBEL%(

       

DATA: g#_)og TYPE zewb_)og. DATA: zewb_)og . g#_)og7 g#_)og7+date < #07 #07datum. datum. g#_)og7 g#_)og7+t!me < #07 #07uze!t. uze!t. g#_)og7 g#_)og7$be)n < g#_$br%7 g#_$br%7$be)n. $be)n. g#_)og7 g#_)og7t+ode < #07 #07t+ode. t+ode.

IF gt_$brp=> I2 NOT INITIA. INITIA. IF gt_$brp=> I2 INITIA AND gt_$br%=> I2 INITIA AND gt_%om$=> I2 INITI A. A .   g#_)og7 g#_)og7me##age < ?In$o!+e deta!)# m!##!ng.?. m!##!ng.?.   g#_)og7 g#_)og7#tatu# < ?F? ?F?. . @ODIFY zewb_)og F1O@ g#_)og. g#_)og . E;IT. E;IT . ENDIF. ENDIF . CA FUNCTION ?E3B_6ET_IN_DETAI2? TABE2   gt_$brp < gt_$brp   gt_$br% < gt_$br%   gt_%om$ < gt_%om$   gt_'eader < gt_'eader   gt_!tem < gt_!tem. gt_!tem . 1EAD TABE gt_'eader INTO g#_'eader 3IT4 EY d$a)!d < ?N? ?N?. . IF #07 #07#ubr+ < .   g#_)og7 g#_)og7me##age < g#_'eader7 g#_'eader7dme##age. dme##age .   g#_)og7 g#_)og7#tatu# < ?F? ?F?. . @ODIFY zewb_)og F1O@ g#_)og. g#_)og . E;IT. E;IT . ENDIF. ENDIF . IF gt_'eader=> I2 INITIA O1 gt_!tem=> I2 INITIA. INITIA.

   

g#_)og7me##age < ?In$o!+e 4eader deta!)# not e,tra+ted.?. g#_)og7#tatu# < ?F?. @ODIFY zewb_)og F1O@ g#_)og. E;IT. ENDIF. ENDIF.

********************************************************************** * !reparin) Inoice /ata( OOP AT gt_'eader INTO g#_'eader.        

!t_!n$7#upp)0t0pe < ?O?. !t_!n$7#ub#upp)0t0pe < ?"?. !t_!n$7do+t0pe < g#_'eader7zdo+t0p. "2I%V2( !t_!n$7do+no < g#_'eader7$be)n.

CONCATENATE g#_'eader75%dat-/ g#_'eader75%dat9-/ g#_'eader7 5%dat-9/ INTO !t_!n$7do+date 2EPA1ATED BY ??. * it_in-docdate 1 234536567382( * it_in-fro9)0tin 1 274AAAG63343%2( " )0_;eader-f_)0tin( "274AAAG63 343%2( ")0_;eader-f_)0tin(

       

IF #07#0#!d < ?OCP?. "!roduction !t_!n$75romg#t!n < g#_'eader75_g#t!n. !t_!n$7tog#t!n < g#_'eader7t_g#t!n. E2E. !t_!n$75romg#t!n < ?GAAAC6""G1"N?. !t_!n$7tog#t!n < ?GAAAC6"9A"?. ENDIF.

  !t_!n$75romtrdname < ?O1IENT CE@ENT TD?. ")0_;eader-f_na9e3(   !t_!n$75romaddr" < g#_'eader75_ad)!ne".   !t_!n$75romaddr < g#_'eader75_ad)!ne.   !t_!n$75romp)a+e < g#_'eader75_ort".   !t_!n$75romp!n+ode < g#_'eader75_p#t)z.   !t_!n$7a+t5rom#tate+ode < g#_'eader75_reg!o.   !t_!n$75rom#tate+ode < g#_'eader75_reg!o.   !t_!n$7totrdname < g#_'eader7t_name.   !t_!n$7toaddr" < g#_'eader7t_#tr_#upp)".   !t_!n$7toaddr < g#_'eader7t_#tr_#upp).   !t_!n$7top)a+e < g#_'eader7t_ort".   !t_!n$7top!n+ode < g#_'eader7t_p#t)z.   !t_!n$7a+tto#tate+ode < g#_'eader7t_reg!o.   !t_!n$7to#tate+ode < g#_'eader7t_reg!o.   !t_!n$7tota)$a)ue < g#_'eader7totnet$a)." %et Value ")0_;eader-total( "%et < Ta= 

     

CONDEN2E !t_!n$7tota)$a)ue. !t_!n$7+g#t$a)ue < g#_'eader7+g#t$a). CONDEN2E !t_!n$7+g#t$a)ue. !t_!n$7#g#t$a)ue < g#_'eader7#g#t$a). CONDEN2E !t_!n$7#g#t$a)ue. !t_!n$7!g#t$a)ue < g#_'eader7!g#t$a).

CONDEN2E !t_!n$7!g#t$a)ue.   !t_!n$7+e##$a)ue < g#_'eader7+e##$a). CONDEN2E !t_!n$7+e##$a)ue.   !t_!n$7tot!n$$a)ue < g#_'eader7tot$a). "%et < Ta= ")0_;eadertotnetal(" %et Value "2>?4@82( CONDEN2E !t_!n$7tot!n$$a)ue.          

!t_!n$7tran#porter!d < ??. !t_!n$7tran#portername < g#_'eader7ztran#name. !t_!n$7tran#do+no < g#_'eader7ztran#do+. !t_!n$7tran#mode < g#_'eader7tran#mode. "232( !t_!n$7tran#d!#tan+e < g#_'eader7ztran#d!#t. "2642( " CONCATENATE g#_'eader7ztran#dt-/ g#_'eader7ztran#dt9-/ g#_'eader7 ztran#dt-9/ INTO !t_!n$7tran#do+date 2EPA1ATED BY ??. * it_in-tran0docdate 1 )0_;eader-tran0dt(

   

        *

* *            

!t_!n$7$e'!+)eno < g#_'eader7#!gn!. !t_!n$7$e'!+)et0pe < ?1?.

"2!V36?>2(

DATA: )$_de+ TYPE +'ar". OOP AT gt_!tem INTO g#_!tem 34E1E $be)n < g#_'eader7$be)n. CA FUNCTION ?CONE12ION_E;IT_AP4A_OUTPUT? E;PO1TIN6 !nput < g#_!tem7matnr I@PO1TIN6 output < g#_!tem7matnr. !tem)!#t7produ+tname < g#_!tem7ar%t,. ")0_ite9-9atnr( !tem)!#t7produ+tde#+ < g#_!tem7ar%t,. !tem)!#t7'#n+ode < g#_!tem7#teu+. !tem)!#t7(uant!t0 < g#_!tem75%!mg. S!LIT ite9li0t-Cuantit' AT 2(2 I%T$ ite9li0t-Cuantit' l_dec( CONDEN2E !tem)!#t7(uant!t0 NO76AP2. 2EECT 2IN6E ewb_uom F1O@ zewb_uom INTO !tem)!#t7(t0un!t &DEE 0ap_uo9 1 2MT2 ( 34E1E #ap_uom < g#_!tem7$r%me. ite9li0t-Ct'unit 1 2MTS2( ")0_ite9-r,9e( !tem)!#t7+g#trate < g#_!tem7+g#t. CONDEN2E !tem)!#t7+g#trate. !tem)!#t7#g#trate < g#_!tem7#g#t. CONDEN2E !tem)!#t7#g#trate. !tem)!#t7!g#trate < g#_!tem7!g#t. CONDEN2E !tem)!#t7!g#trate. !tem)!#t7+e##rate < ??. CONDEN2E !tem)!#t7+e##rate. !tem)!#t7+e##ad$o) < ??. CONDEN2E !tem)!#t7+e##ad$o). !tem)!#t7ta,ab)eamount < g#_!tem7tot$a). CONDEN2E !tem)!#t7ta,ab)eamount. APPEND !tem)!#t TO !t_!n$7!tem)!#t. CEA1:g#_!tem.

ENDOOP.

 

     

CA FUNCTION ?E3B_6ET_TOEN? I@PO1TIN6 to%en < to%en me##age < to%en_me##age. IF to%en I2 INITIA. IF to%en_me##age I2 NOT INITIA. g#_)og7me##age < to%en_me##age. E2E. g#_)og7me##age < ?To%en not a)!d?. ENDIF. g#_)og7#tatu# < ?F?. @ODIFY zewb_)og F1O@ g#_)og. E;IT. ENDIF.

CEA1: )$_*#on_+'ar. CA FUNCTION ?E3B_IN_TO_H2ON? E;PO1TIN6   !t_!n$ < !t_!n$ I@PO1TIN6   *#on_out < )$_*#on_+'ar. IF )$_*#on_+'ar I2 INITIA.   g#_)og7me##age < ?H2ON Con$er#!on 5a!)ed?.   g#_)og7#tatu# < ?F?. @ODIFY zewb_)og F1O@ g#_)og. E;IT. ENDIF. * )0_lo)-S$% 1 l_0on_c;ar(   )$_5g#t!n < !t_!n$75romg#t!n. CA FUNCTION ?E3B_6EN_F1O@_H2ON? E;PO1TIN6   *#on_!n < )$_*#on_+'ar   $be)n < g#_$br%7$be)n   to%en < to%en   5_g#t!n < )$_5g#t!n I@PO1TIN6   re#pon#e < )$_re#pon#e   re(ue#t!d < re(ue#t!d.   !t_a)$7do+no < g#_$br%7$be)n. *************************************************************************** ********************************* ************************************************0on to Ita+*************** ********************************* *************************************************************************** *********************************   *#on_out < )$_re#pon#e. DATA: re#_)en-"/ TYPE n.   re#_)en < #tr)en- )$_re#pon#e /.

    * *        

*  

g#_re(7re(ue#t!d < re(ue#t!d. g#_re(7ap!t0pe < ?6EN?. )0_reC-0on 1 l_0on_c;ar( )0_reC-re0pon0e 1 l_re0pon0e( IF re#_)en 6T ". g#_re(7re#pon#e < )$_re#pon#e-"/. E2E. g#_re(7re#pon#e < )$_re#pon#e. ENDIF. g#_re(7+date < #07datum. g#_re(7+t!me < #07uze!t. @ODIFY zewb_re( F1O@ g#_re(.

IF *#on_out-"/ < ??. )0_lo)-ES!$%SE 1 l_re0pon0e( CEA1: !t_re#u)t. +)_5dt_*#on. DEETE gt_!tem" 34E1E $be)n NE !t_a)$7do+no. CEA1:g#_!tem". 1EAD TABE gt_!tem" INTO g#_!tem" 3IT4 EY $be)n < !t_a)$7do+no. IF #07#ubr+ EK .   g#_!tem"7ewbno < !t_a)$7ewbno. @ODIFY zewb_!n$!tem F1O@ g#_!tem". ENDIF. *************************************************************************** ***************************************************************** * Update e+_lo)(   g#_)og7+date < #07datum.   g#_)og7+t!me < #07uze!t.   g#_)og7$be)n < !t_a)$7do+no.   g#_)og7t+ode < #07t+ode.   g#_)og7me##age < !t_a)$7me##age.   g#_)og7#tatu# < ?2?.   g#_)og7ewbno < !t_re#u)t7re#u)t7ewa0b!))no.   g#_)og7ewbdt < g#_'eader"7ewbdt.   g#_)og7ewbtm < g#_'eader"7ewbtm. IF re#_)en 6T ".   g#_)og7re#pon#e < )$_re#pon#e-"/. E2E.   g#_)og7re#pon#e < )$_re#pon#e. ENDIF. * )0_lo)-0on 1 l_0on_c;ar( @ODIFY zewb_)og F1O@ g#_)og. CEA1: g#_)og. * )0_lo)-MESSAGE 1 it_re0ult-MESSAGE(

*************************************************************************** *****************************************************************

E2E. *************************************************************************** ***************************************************************** * Update e+_lo)(   g#_)og7+date < #07datum.   g#_)og7+t!me < #07uze!t.   g#_)og7$be)n < !t_a)$7do+no.   g#_)og7t+ode < #07t+ode.   g#_)og7me##age < !t_a)$7me##age.   g#_)og7#tatu# < ?F?. * )0_lo)-e+no 1 it_re0ult-re0ult-ea'+illno( * )0_lo)-e+dt 1 )0_;eader3-e+dt( * )0_lo)-e+t9 1 )0_;eader3-e+t9( IF re#_)en 6T ".   g#_)og7re#pon#e < )$_re#pon#e-"/. E2E.   g#_)og7re#pon#e < )$_re#pon#e. ENDIF. * )0_lo)-0on 1 l_0on_c;ar( @ODIFY zewb_)og F1O@ g#_)og. CEA1: g#_)og. * )0_lo)-MESSAGE 1 it_re0ult-MESSAGE(

*************************************************************************** ***************************************************************** ENDIF. E2E. CEA1: !t_error.   +)_5dt_*#on
View more...

Comments

Copyright ©2017 KUPDF Inc.
SUPPORT KUPDF