Skip to Content
avatar image
Former Member

sql in sap hana:

Hi all, I am new to sql ,I have an abap code as below can any one help me to write the same in sql in sap hana:-

SELECT SINGLE * INTO CORRESPONDING FIELDS OF wa_bseg FROM bseg AS a INNER JOIN bkpf AS b ON a~belnr = b~belnr AND a~gjahr = b~gjahr WHERE a~bschl = '81' AND a~vbel2 = wa_lips-vgbel AND a~posn2 = wa_lips-vgpos AND a~menge = wa_output-fkimg AND b~xblnr = wa_lips-vbeln. IF sy-subrc EQ 0. wa_output-belnr = wa_bseg-belnr. wa_output-prctr = wa_bseg-prctr. wa_output-wrbtrd = wa_bseg-pswbt. wa_output-pswsl = wa_bseg-pswsl. wa_output-cogsr = wa_bseg-dmbe2. SELECT SINGLE budat FROM bkpf INTO wa_output-budat WHERE bukrs = wa_bseg-bukrs AND belnr = wa_bseg-belnr AND gjahr = wa_bseg-gjahr. ENDIF. ENDIF. ELSE. wa_output-lfimg = 0. wa_output-lmeins = '**'. ENDIF. CLEAR wa_bseg. SELECT SINGLE * FROM bseg INTO wa_bseg WHERE bukrs = wa_output-vkorg AND belnr = wa_output-vbeln AND gjahr = wa_output-fkdat+0(4) AND bschl = '50' AND wrbtr = wa_output-netwr AND matnr = wa_output-matnr AND menge = wa_output-fkimg. IF sy-subrc = 0. wa_output-netvaluer = wa_bseg-dmbe2. wa_output-netvaluelc = wa_bseg-dmbtr. ENDIF.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

0 Answers