How To Join Internal tablr
I try to join 4 internal tables to move valut to t_output
DATA: BEGIN OF t_inv_header OCCURS 0,
vbeln TYPE vbrk-vbeln, "Billing No.
xblnr TYPE vbrk-xblnr, "Tax Invoice.
vkorg TYPE vbrk-vkorg, "Sales Org.
vtweg TYPE vbrk-vtweg, "Distribute Channel
spart TYPE vbrk-spart, "Division
kunag TYPE vbrk-kunag, "Sold to Party
fkdat TYPE vbrk-fkdat, "Billing Date.
erdat TYPE vbrk-erdat, "Create On
erzet TYPE vbrk-erzet, "Create Time
name1 TYPE adrc-name1, "Sales Org name1
datum TYPE sy-datum, "Date
uzeit TYPE sy-uzeit, "Time
pagno(4) TYPE c, "Page qty.
END OF t_inv_header.
DATA: BEGIN OF t_inv_item OCCURS 0,
vkorg TYPE vbrk-vkorg, "Sales Org.
vtweg TYPE vbrk-vtweg, "Distribute Channel
vbeln TYPE vbrk-vbeln, "Billing No.
posnr TYPE vbrp-posnr, "Billing Item.
werks TYPE vbrp-werks, "Plant
kvgr1 TYPE vbrp-kvgr1, "Customer Group.
fkimg TYPE vbrp-fkimg, "Billing Quantity.
arktx TYPE vbrp-arktx, "Customer Material.
matnr TYPE vbrp-matnr, "Material No.
vgbel TYPE vbrp-vgbel, "Outbound delivery no.
vgpos TYPE vbrp-vgpos, "Outbound delivery item.
aubel TYPE vbrp-aubel, "Sale Order no.
aupos TYPE vbrp-aupos, "Sale Order Item.
END OF t_inv_item.
DATA: BEGIN OF t_so OCCURS 0,
vbeln TYPE vbkd-vbeln, "Sale Order No.
posnr TYPE vbkd-posnr, "Sale Order Item.
bstkd TYPE vbkd-bstkd, "PO Sold-to [PO Header].
bstkd_e TYPE vbkd-bstkd_e, "PO Ship-To
END OF t_so.
DATA: BEGIN OF t_outb OCCURS 0,
vbeln TYPE likp-vbeln, "Outbound delivery no.
kunnr TYPE likp-kunnr, "Ship-to party
vstel TYPE likp-vstel, "Shipping Point
lfdat TYPE likp-lfdat, "Delivery date
posnr TYPE lips-posnr, "Outbound Delivery Item.
matnr TYPE lips-matnr, "Mat no.
END OF t_outb.
DATA: BEGIN OF t_output OCCURS 0,
vbeln TYPE vbrk-vbeln, "Billing No.
posnr TYPE vbrp-posnr, "Billing Item.
kvgr1 TYPE vbrp-kvgr1, "Customer Group.
fkimg TYPE vbrp-fkimg, "Billing Quantity.
arktx TYPE vbrp-arktx, "Customer Material.
matnr TYPE vbrp-matnr, "Material No.
vgbel TYPE vbrp-vgbel, "Outbound delivery no.
vgpos TYPE vbrp-vgpos, "Outbound delivery item.
aubel TYPE vbrp-aubel, "Sale Order no.
aupos TYPE vbrp-aupos, "Sale Order Item.
bstkd TYPE vbkd-bstkd, "PO Sold-to [PO Header].
bstkd_e TYPE vbkd-bstkd_e, "PO Ship-To
lfdat TYPE likp-lfdat, "Delivery date
END OF t_output.
How can I do it? or do you have better solution. please suggest.
And other question I try to filter Billing Type by using this code
SELECT vbrkvbeln vbrkxblnr vbrk~vkorg
vbrkvtweg vbrkspart vbrk~kunag
vbrkfkdat vbrkerdat
vbrk~erzet
INTO TABLE t_inv_header
FROM vbrk
WHERE vbrk~vkorg IN s_vkorg
AND vbrk~fkart NOT IN
('ZB50','ZB54','ZB60','ZB64','ZB70','ZB71','ZC++')
AND vbrk~erdat IN s_erdat
AND vbrk~erzet IN s_erzet
AND vbrk~vbeln IN s_vbeln
AND vbrk~kunag IN s_kunag
AND vbrk~fkdat IN s_fkdat.
But It does not work, How can I filter Billing Type all ZC++ out (for excample, ZC01 ZC02 ZC03 ZC04 ZC05)
hi,
do this way ..
loop at t_inv_item.
read table t_inv_header with key vbeln = t_inv_item-vbeln.
if sy-subrc = 0.
read table t_so with key vbeln = t_inv_item-vbeln
posnr = t_inv_item-posnr.
if sy-subrc = 0.
read table t_outb with key vbeln = t_inv_item-vbeln
posnr = t_inv_item-posnr.
if sy-subrc = 0.
t_output-vbeln = t_inv_item-vbeln.
t_output-posnr = t_inv_item-posnr. "Billing Item.
t_output-kvgr1 = t_inv_item-kvgr1. "Customer Group.
t_output-fkimg = t_inv_item-fkimg. "Billing Quantity.
t_output-arktx = t_inv_item-arktx. "Customer Material.
t_output-matnr = t_inv_item-matnr. "Material No.
t_output-vgbel = t_inv_item-vgbel. "Outbound delivery no.
t_output-vgpos = t_inv_item-vgpos. "Outbound delivery item.
t_output-aubel = t_inv_item-aubel. "Sale Order no.
t_output-aupos = t_inv_item-aupos. "Sale Order Item.
t_output-bstkd = t_so-bstkd. "PO Sold-to PO Header.
t_output-bstkd_e = t_so-bstkd_e. "PO Ship-To
t_output-lfdat = t_outb-lfdat. "Delivery date
append t_output.
clear t_output.
endif.
endif.
endif.
endloop.
Regards,
Santosh
Similar Messages
-
How to join THREE different tables into internal table using one select statement .
How to join THREE different tables into internal table using one select statement .
Hi experts,
I would like to request your guidance in solving the problem of joining the data from three different database tables into one internal table
Scenario:
Database tables:
SPFLI
SFLIGHT
SBOOK.
Table Fields:
SPFLI - CARRID CONNID COUNTRYFR CITYFRM COUNTRYTO CITYTO
SFLIGHT - CARRID CONNID FLDATE SEATSMAX SEATSOCC SEATSMAX_C
SEATSOCC_C SEATSMAX_F SEATSOCC_F
SBOOK - CARRID CONNID CLASS
MY INTERNAL TABLE IS IT_XX.
Your help much appreciated.
Thanks in advance.
Pawan.Hi Pawan,
please check below codes. hope it can help you.
TYPES: BEGIN OF ty_xx,
carrid TYPE spfli-carrid ,
connid TYPE spfli-connid ,
countryfr TYPE spfli-countryfr,
cityfrom TYPE spfli-cityfrom ,
countryto TYPE spfli-countryto,
cityto TYPE spfli-cityto ,
fldate TYPE sflight-fldate ,
seatsmax TYPE sflight-seatsmax ,
seatsocc TYPE sflight-seatsocc ,
seatsmax_b TYPE sflight-seatsmax_b,
seatsocc_b TYPE sflight-seatsocc_b,
seatsmax_f TYPE sflight-seatsmax_f,
seatsocc_f TYPE sflight-seatsocc_f,
class TYPE sbook-class,
END OF ty_xx,
t_xx TYPE STANDARD TABLE OF ty_xx.
DATA: it_xx TYPE t_xx.
SELECT spfli~carrid
spfli~connid
spfli~countryfr
spfli~cityfrom
spfli~countryto
spfli~cityto
sflight~fldate
sflight~seatsmax
sflight~seatsocc
sflight~seatsmax_b
sflight~seatsocc_b
sflight~seatsmax_f
sflight~seatsocc_f
sbook~class
INTO TABLE it_xx
FROM spfli INNER JOIN sflight
ON spfli~carrid = sflight~carrid
AND spfli~connid = sflight~connid
INNER JOIN sbook
ON spfli~carrid = sbook~carrid
AND spfli~connid = sbook~connid.
Thanks,
Yawa -
How to join two internal table rows in alternative manner into one internal table?
How to join two internal table rows in alternative manner into one internal table?
two internal tables are suppose itab1 & itab2 & its data
Header 1
Header 2
Header 3
a
b
c
d
e
f
g
h
i
Header 1
Header 2
Header 3
1
2
3
4
5
6
7
8
9
INTO itab3 data
Header 1
Header 2
Header 3
a
b
c
1
2
3
d
e
f
4
5
6
g
h
i
7
8
9Hi Soubhik,
I have added two additional columns for each internal table.
Table_Count - It represents the Internal Table Number(ITAB1 -> 1, ITAB2 -> 2)
Row_Count - It represents the Row Count Number, increase the row count value 1 by one..
ITAB1:
Header 1
Header 2
Header 3
Table_Count
Row_Count
a
b
c
1
1
d
e
f
1
2
g
h
i
1
3
ITAB2:
Header 1
Header 2
Header 3
Table_Count
Row_Count
1
2
3
2
1
4
5
6
2
2
7
8
9
2
3
Create the Final Internal table as same as the ITAB1/ITAB2 structure.
"Data Declarations
DATA: IT_FINAL LIKE TABLE OF ITAB1. "Final Internal Table
FIELD-SYMBOLS: <FS_TAB1> TYPE TY_TAB1, "TAB1
<FS_TAB2> TYPE TY_TAB2. "TAB2
"Assign the values for the additional two column for ITAB1
LOOP AT ITAB1 ASSIGNING <FS_TAB1>.
<FS_TAB1>-TABLE_COUNT = 1. "Table value same for all row
<FS_TAB1>-ROW_COUNT = SY-TABIX. "Index value
ENDLOOP.
"Assign the values for the additional two column for ITAB2
LOOP AT ITAB2 ASSIGNING <FS_TAB2>.
<FS_TAB2>-TABLE_COUNT = 2. "Table value same for all row
<FS_TAB2>-ROW_COUNT = SY-TABIX. "Index value
ENDLOOP.
"Copy the First Internal Table 'ITAB1' to Final Table
IT_FINAL[] = ITAB1[].
"Copy the Second Internal Table 'ITAB2' to Final Table
APPEND IT
LOOP AT ITAB2 INTO WA_TAB2.
APPEND WA_TAB2 TO IT_FINAL.
ENDLOOP.
"Sort the Internal Table based on TABLE_COUNT & ROW_COUNT
SORT IT_FINAL BY ROW_COUNT TABLE_COUNT.
After sorting, check the output for IT_FINAL Table, you can find the required output as shown above.
Regards
Rajkumar Narasimman -
How to join fields from different internal tables and display into one int
hai i have one doubt...
how to join fields from different internal tables and display into one internal table..
if anybody know the ans for this qus tell me......hii
you can read data as per condition and then can join in one internal table using READ and APPEND statement..refer to following code.
SELECT bwkey " Valuation Area
bukrs " Company Code
FROM t001k
INTO TABLE i_t001k
WHERE bukrs IN s_bukrs.
IF sy-subrc EQ 0.
SELECT bwkey " Valuation Area
werks " Plant
FROM t001w
INTO TABLE i_t001w
FOR ALL ENTRIES IN i_t001k
WHERE bwkey = i_t001k-bwkey
AND werks IN s_werks.
IF sy-subrc EQ 0.
LOOP AT i_output INTO wa_output.
READ TABLE i_t001w INTO wa_t001w WITH KEY werks = wa_output-werks.
READ TABLE i_t001k INTO wa_t001k WITH KEY bwkey = wa_t001w-bwkey.
wa_output-bukrs = wa_t001k-bukrs.
MODIFY i_output FROM wa_output.
CLEAR wa_output.
ENDLOOP. " LOOP AT i_output
ENDIF. " IF sy-subrc EQ 0
regards
twinkal -
How to Populate Internal table data to Table Control in a Report Program
Dear All,
How to Populate Internal table data to Table Control in a Report Program? It is a pure report program with out any Module pool coding involved, which is just used to display data. Till now it is being displayed in a report. Now the user wants the data to be displayed in a table control. Could someone tell me how to go about with this.
Thanks in Advance,
Joseph ReddyIf you want to use a table control, you will need to create a screen.
In your report....
start-of-selection.
perform get_data. " Get all your data here
call screen 100. " Now present to the user.
Double click on the "100" in your call screen statement. This will forward navigate you to the screen. If you have not created it yet, it will ask you if you want to create it, say yes. Go into screen painter or layout of the screen. Use the table control wizard to help you along the process. It will write the code for you. Since it is an output only table control, it will be really easy with not a lot of code.
A better way to present the data to the user would be to give it in a ALV grid. If you want to go that way, it is a lot easier. Here is a sample of the ALV function module. You don't even have to create a screen.
report zrich_0004
no standard page heading.
type-pools slis.
data: fieldcat type slis_t_fieldcat_alv.
data: begin of imara occurs 0,
matnr type mara-matnr,
maktx type makt-maktx,
end of imara.
* Selection Screen
selection-screen begin of block b1 with frame title text-001 .
select-options: s_matnr for imara-matnr .
selection-screen end of block b1.
start-of-selection.
perform get_data.
perform write_report.
* Get_Data
form get_data.
select mara~matnr makt~maktx
into corresponding fields of table imara
from mara
inner join makt
on mara~matnr = makt~matnr
where mara~matnr in s_matnr
and makt~spras = sy-langu.
endform.
* WRITE_REPORT
form write_report.
perform build_field_catalog.
* CALL ABAP LIST VIEWER (ALV)
call function 'REUSE_ALV_GRID_DISPLAY'
exporting
it_fieldcat = fieldcat
tables
t_outtab = imara.
endform.
* BUILD_FIELD_CATALOG
form build_field_catalog.
data: fc_tmp type slis_t_fieldcat_alv with header line.
clear: fieldcat. refresh: fieldcat.
clear: fc_tmp.
fc_tmp-reptext_ddic = 'Material Number'.
fc_tmp-fieldname = 'MATNR'.
fc_tmp-tabname = 'IMARA'.
fc_tmp-outputlen = '18'.
fc_tmp-col_pos = 2.
append fc_tmp to fieldcat.
clear: fc_tmp.
fc_tmp-reptext_ddic = 'Material'.
fc_tmp-fieldname = 'MAKTX'.
fc_tmp-tabname = 'IMARA'.
fc_tmp-outputlen = '40'.
fc_tmp-col_pos = 3.
append fc_tmp to fieldcat.
endform.
Regards,
Rich Heilman -
How to join local computer to virtual server domain ?
Hi everyone,
I am new to Window Azure cloud computing. I found many articles and tutorials available online but I am kind of lost because I don't what I need to do to achieve my scenario.
Scenario: I want to migrate my servers to cloud and retire all local servers such as DC and file server. At the same time, I wish to control the network traffic to limit the clients access to Internet resources. I am not sure retiring the
all local servers is something right to do and how to do.
What I have done:
1. Site-to-Site VPN connection with Dell Sonicwall TZ205 to VNet. (I followed the route-based VPN in this document -> https://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&ved=0CB0QFjAA&url=https%3A%2F%2Fsupport.software.dell.com%2Fdownload%2Fdownloads%3Fid%3D5343958&ei=ykGhVIK6GISWuASU6oHQBw&usg=AFQjCNGGS6fsuK6IHAWyQgZi5fey4xhfKg&bvm=bv.82001339,d.c2E&cad=rja)
2. Created a VM in the VNet. (I can ping the VM from computers connected to TZ205)
3. Installed active directory and configured the domain forest.
What I need to do:
1. How to join the local computers to the virtual server domain controller with S2S and P2S VPN. (Some Internet resources mentioned I need to install Connect agent in order to do this)
Extra questions:
1. Is it possible to request the clients to provide account credentials before the point-to-site VPN to VNet is established ?
2. How do I configure the TZ205 VPN router to send all the Internet traffic to the VNet instead of the ISP gateway? The computers connected to TZ205 firewall router public IP address doesn't change to the VNet gateway IP.
Thanks for your time reading my questions. It will be helpful if you can provide me some useful links or ideas.
Sincerely,
Chee-KianGreetings!
I assume there is connectivity between on-prem device and DC on Azure VM.
You can set the Internal IP of the DC as DNS on the on-prem device and trying joining it to the existing domain. Please note to use S2S VPN.
It is not possible to provide user credentials while connecting to vNet via P2S VPN. It's a certificate based authentication (which is so by design).
With regards to your query to send all internet traffic to vNet instead of ISP gateway. Please refer to Forced Tunneling:
http://msdn.microsoft.com/en-us/library/azure/dn835140.aspx
Hope this helps.
Thank you,
Arvind -
How to join cluster table?
How to join the cluster table with the transparent table?In specific ,can you pls tell me how can i join bkpf and bseg?
Hi Aravind,
Check this code,
tables : bkpf,
bseg.
INTERNAL TABLE AND WORK AREA FOR THE FIELDS IN BKPF TABLE *
data : begin of itab_bkpf occurs 0,
bukrs like bkpf-bukrs, "Company Code.
gjahr like bkpf-gjahr, "Fiscal Year.
budat like bkpf-budat, "Posting Date in the Document.
belnr like bkpf-belnr, "Accounting document number.
blart like bkpf-blart, "Document Type.
end of itab_bkpf.
data : wa_bkpf like line of itab_bkpf.
INTERNAL TABLE AND WORK AREA FOR THE FIEDLS IN BSEG TABLE *
data : begin of itab_bseg_debit occurs 0,
bukrs like bseg-bukrs, "Company Code.
gjahr like bseg-gjahr, "Fiscal Year.
belnr like bseg-belnr, "Accounting Document Number.
buzei like bseg-buzei, "Line Item.
hkont like bseg-hkont, "General Leadger Account.
shkzg like bseg-shkzg, "Credit/Debit Indicator.
wrbtr like bseg-wrbtr, "Amount in Document Currency.
pswsl like bseg-pswsl, "Update Currency for Gen.Ledger
dmbtr like bseg-dmbtr, "Amount in local currency.
sgtxt like bseg-sgtxt, "Item Text.
zuonr like bseg-zuonr, "Assignment Number.
end of itab_bseg_debit.
data : itab_bseg_credit like standard table of itab_bseg_debit with
header line.
FINAL OUTPUT INTERNAL TABLE *
data : begin of itab_output occurs 0,
belnr(08) ,
bukrs(04) ,
budat like bkpf-budat,
buzei(03) ,
hkont(07) ,
blart(02) ,
shkzg(01) ,
wrbtr(08) ,
pswsl(05) ,
dmbtr(10) ,
sgtxt(19) ,
zuonr(10) ,
end of itab_output.
constants : c_debit type c value 'S',
c_credit type c value 'H'.
SELECT-OPTIONS *
selection-screen begin of block input with frame title text-t01.
select-options : s_bukrs for bkpf-bukrs.
parameters : p_year like bkpf-gjahr visible length 2.
select-options : s_budat for bkpf-budat,
s_dbacct for bseg-hkont,
s_cracct for bseg-hkont,
s_amt for bseg-dmbtr.
selection-screen end of block input.
SELECTING RECORDS FROM BKPF TABLE BASED ON THE CONDITION *
select bukrs gjahr budat belnr blart
from bkpf into table itab_bkpf
where bukrs in s_bukrs and
gjahr eq p_year and
budat in s_budat.
SELECTING DEBIT LINE ITEMITEMS FROM BSEG FOR THE DOCUMENT *
NUMBER SELECTED FROM BKPF *
if not itab_bkpf[] is initial.
select bukrs gjahr belnr buzei
hkont shkzg wrbtr pswsl
dmbtr sgtxt zuonr
from bseg into table itab_bseg_debit
for all entries in itab_bkpf
where bukrs eq itab_bkpf-bukrs and
belnr eq itab_bkpf-belnr and
gjahr eq itab_bkpf-gjahr and
hkont in s_dbacct and
shkzg eq c_debit and
dmbtr in s_amt.
SELECTING CREDIT LINE ITEMITEMS FROM BSEG FOR THE DOCUMENT *
NUMBER SELECTED FROM BKPF *
select bukrs gjahr belnr buzei
hkont shkzg wrbtr pswsl
dmbtr sgtxt zuonr
from bseg into table itab_bseg_credit
for all entries in itab_bkpf
where bukrs eq itab_bkpf-bukrs and
belnr eq itab_bkpf-belnr and
gjahr eq itab_bkpf-gjahr and
hkont in s_cracct and
shkzg eq c_credit and
dmbtr in s_amt.
endif.
sort itab_bkpf by bukrs gjahr belnr.
sort itab_bseg_credit by bukrs gjahr belnr.
LOOPING THE DEBIT ENTRIES *
loop at itab_bseg_debit.
READING THE CREDIT ENTRIES WHICH MATCHES WITH HE CURRENT DOC. NUMBER *
read table itab_bseg_credit with key
bukrs = itab_bseg_debit-bukrs
gjahr = itab_bseg_debit-gjahr
belnr = itab_bseg_debit-belnr binary search.
if sy-subrc eq 0.
*READING THE POSTING DATE AND DOCUMENT TYPE FOR THE CURRENT DOUCMENT *
AND APPENDING THE DEBIT AND CREDIT ENTRIES *
read table itab_bkpf into wa_bkpf with key
bukrs = itab_bseg_debit-bukrs
gjahr = itab_bseg_debit-gjahr
belnr = itab_bseg_debit-belnr binary search.
itab_output-belnr = itab_bseg_debit-belnr.
itab_output-bukrs = itab_bseg_debit-bukrs.
itab_output-budat = wa_bkpf-budat.
itab_output-buzei = itab_bseg_debit-buzei.
itab_output-hkont = itab_bseg_debit-hkont.
itab_output-blart = wa_bkpf-blart.
itab_output-shkzg = itab_bseg_debit-shkzg.
itab_output-wrbtr = itab_bseg_debit-wrbtr.
itab_output-pswsl = itab_bseg_debit-pswsl.
itab_output-dmbtr = itab_bseg_debit-dmbtr.
itab_output-sgtxt = itab_bseg_debit-sgtxt.
itab_output-zuonr = itab_bseg_debit-zuonr.
append itab_output.
itab_output-belnr = itab_bseg_credit-belnr.
itab_output-bukrs = itab_bseg_credit-bukrs.
itab_output-budat = wa_bkpf-budat.
itab_output-buzei = itab_bseg_credit-buzei.
itab_output-hkont = itab_bseg_credit-hkont.
itab_output-blart = wa_bkpf-blart.
itab_output-shkzg = itab_bseg_credit-shkzg.
itab_output-wrbtr = itab_bseg_credit-wrbtr.
itab_output-pswsl = itab_bseg_credit-pswsl.
itab_output-dmbtr = itab_bseg_credit-dmbtr.
itab_output-sgtxt = itab_bseg_credit-sgtxt.
itab_output-zuonr = itab_bseg_credit-zuonr.
append itab_output.
endif.
endloop.
sort itab_output by belnr budat shkzg.
LOOPING OUTPUT INTERNAL TABLE *
*FORMAT INTENSIFIED INPUT.
*FORMAT INVERSE ON.
loop at itab_output.
format hotspot on.
format color 5 inverse.
write :/ sy-vline,
000 itab_output-belnr, 12 sy-vline,
013 itab_output-bukrs, 17 sy-vline,
019 itab_output-budat, sy-vline,
034 itab_output-buzei, 40 sy-vline,
042 itab_output-hkont, sy-vline,
054 itab_output-blart, 60 sy-vline,
065 itab_output-shkzg, 70 sy-vline,
072 itab_output-wrbtr, sy-vline,
085 itab_output-pswsl, sy-vline,
093 itab_output-dmbtr, sy-vline,
106 itab_output-sgtxt, sy-vline,
itab_output-zuonr, sy-vline.
format hotspot off.
endloop.
uline 0(139).
<b>Regards,
Jackie.</b> -
How to join SAP Design Studio - Design Council
Hello Everyone,
Does anyone know how to join Design Studio - Design Council.
I am working on a internal project and would love to provide feedback to product team at SAP.
Thanks,
RajanI am not aware of a council like this for Design Studio
There is SAP Lumira's Momentum Grows – Join the BI Design Council, and Co-Innovate with us! for Lumira
ASUG has a Design Studio Influence Council. If you are an ASUG member, you can contact ASUG about it at influence at asug dot com.
You can also provide feedback on Idea Place - ideas.sap.com
Tammy -
Hai
i have created an program using ALV and i had created two internal tables namely ITAB and ITAB1.But i wasn't unable to get an output.so i like to know how to join two ITAB in ALV.MAhesh,
Check this ex:
ITAB1 is having fields "A","B", "C".
ITAB2 is having fields "A","D", "E".
Create i_final internal table to have all fields of 2 internal tables.
i_final is having "A","B","C","D","E".
SORT itab1 ,itab2 by A
LOOP AT ITAB1.
READ TABLE itab2 WITH KEY a = itab1-a BINARY
SEARCH.
IF SY-SUBRC EQ 0.
MOVE : itab1-a TO i_final-a,
itab1-b TO i_final-b,
itab1-c TO i_final-c,
itab2-d TO i_final-d,
itab2-e TO i_final-e.
APPEND i_final.
ENDIF.
ENDLOOP.
Don't forget to reward if useful..... -
How to join GRPO with AP invoice thru query ?
hi all,
How to join GRPO with AP invoice in sql query ?
JeyakanthanHi Jeyakanthan
Are you using query in SAP Business One or outside the system? If you select the tables in SAP Business One as OPCH and OPDN then no inner join will appear, as the links sit on the line level. You will need PCH1 and PDN1. The link can be found in both directions, but bear in mind that 1 AP Invoice could be based on more than 1 Goods Receipt PO. For this reason the best approach is to start at the AP Invoice line level and use the BaseType and BaseRef fields to view which lines were pulled from which Goods Receipt PO's.
Kind regards
Peter Juby -
How to Send Internal table to SAP Spool using Function Modules or Methods?
Hi Experts,
How to Send Internal table to SAP Spool using Function Modules or Methods?
Thanks ,
KiranThis is my code.
I still get the no ABAP list data for the spool, even tho I can see it sp01?
REPORT Z_MAIL_PAYSLIP.
* Declaration Part *
tables: PERNR, PV000, T549Q, V_T514D, HRPY_RGDIR.
infotypes: 0000, 0001, 0105, 0655.
data: begin of ITAB occurs 0,
MTEXT(25) type C,
PERNR like PA0001-PERNR,
ABKRS like PA0001-ABKRS,
ENAME like PA0001-ENAME,
USRID_LONG like PA0105-USRID_LONG,
end of ITAB.
data: W_BEGDA like HRPY_RGDIR-FPBEG,
W_ENDDA like HRPY_RGDIR-FPEND.
data: RETURN like BAPIRETURN1 occurs 0 with header line.
data: P_INFO like PC407,
P_FORM like PC408 occurs 0 with header line.
data: P_IDX type I,
MY_MONTH type T549Q-PABRP,
STR_MY_MONTH(2) type C,
MY_YEAR type T549Q-PABRJ,
STR_MY_YEAR(4) type C,
CRLF(2) type x value '0D0A'.
data: W_CMONTH(10) type C.
data: TAB_LINES type I,
ATT_TYPE like SOODK-OBJTP.
data: begin of P_INDEX occurs 0,
INDEX type I,
end of P_INDEX.
constants: begin of F__LTYPE, "type of line
CMD like PC408-LTYPE value '/:', "command
TXT like PC408-LTYPE value 's', "textline
end of F__LTYPE.
constants: begin of F__CMD, "commands
NEWPAGE like PC408-LINDA value '',
end of F__CMD.
data: P_LIST like ABAPLIST occurs 1 with header line.
*data: OBJBIN like SOLISTI1 occurs 10 with header line,
data: OBJBIN like LVC_S_1022 occurs 10 with header line,
DOCDATA like SODOCCHGI1,
OBJTXT like SOLISTI1 occurs 10 with header line,
OBJPACK like SOPCKLSTI1 occurs 1 with header line,
RECLIST like SOMLRECI1 occurs 1 with header line,
OBJHEAD like SOLISTI1 occurs 1 with header line,
it_mess_att LIKE solisti1 OCCURS 0 WITH HEADER LINE,
gd_buffer type string,
l_no_of_bytes TYPE i,
l_pdf_spoolid LIKE tsp01-rqident,
l_jobname LIKE tbtcjob-jobname.
data: file_length type int4,
spool_id type rspoid,
line_cnt type i.
*-------------------------------------------------------------------* * INITIALIZATION *
OBJBIN = ' | '.
append OBJBIN.
OBJPACK-HEAD_START = 1.
data: S_ABKRS like PV000-ABKRS.
data: S_PABRP like T549Q-PABRP.
data: S_PABRJ like T549Q-PABRJ.
* SELECTION SCREEN *
selection-screen begin of block BL1.
parameters: PAY_VAR like BAPI7004-PAYSLIP_VARIANT default 'ESS_PAYSLIPS' obligatory.
selection-screen end of block BL1.
START-OF-SELECTION.
s_ABKRS = PNPXABKR.
S_PABRP = PNPPABRP.
s_pabrj = PNPPABRJ.
w_begda = PN-BEGDA.
w_endda = PN-ENDDA.
get pernr.
* "Check active employees
rp-provide-from-last p0000 space pn-begda pn-endda.
CHECK P0000-STAT2 IN PNPSTAT2.
* "Check Payslip Mail flag
rp-provide-from-last p0655 space pn-begda pn-endda.
CHECK P0655-ESSONLY = 'X'.
rp-provide-from-last p0001 space pn-begda pn-endda.
* "Find email address
RP-PROVIDE-FROM-LAST P0105 '0030' PN-BEGDA PN-ENDDA.
if p0105-usrid_LONG ne ''.
ITAB-PERNR = P0001-PERNR.
ITAB-ABKRS = P0001-ABKRS.
ITAB-ENAME = P0001-ENAME.
ITAB-USRID_LONG = P0105-USRID_LONG.
append itab.
clear itab.
endif.
"SY-UCOMM ='ONLI'
END-OF-SELECTION.
*------------------------------------------------------------------* start-of-selection.
write : / 'Payroll Area : ', S_ABKRS.
write : / 'Payroll Period/Year : ',STR_MY_MONTH,'-',STR_MY_YEAR. write : / 'System Date : ', SY-DATUM.
write : / 'System Time : ', SY-UZEIT.
write : / 'User Name : ', SY-UNAME.
write : / SY-ULINE.
sort ITAB by PERNR.
loop at ITAB.
clear : P_INFO, P_FORM, P_INDEX, P_LIST, OBJBIN, DOCDATA, OBJTXT, OBJPACK, RECLIST, TAB_LINES.
refresh : P_FORM, P_INDEX, P_LIST, OBJBIN, OBJTXT, OBJPACK, RECLIST.
* Retrieve Payroll results sequence number for this run
select single * from HRPY_RGDIR where PERNR eq ITAB-PERNR
and FPBEG ge W_BEGDA
and FPEND le W_ENDDA
and SRTZA eq 'A'.
* Produce payslip for those payroll results
if SY-SUBRC = 0.
call function 'GET_PAYSLIP'
EXPORTING
EMPLOYEE_NUMBER = ITAB-PERNR
SEQUENCE_NUMBER = HRPY_RGDIR-SEQNR
PAYSLIP_VARIANT = PAY_VAR
IMPORTING
RETURN = RETURN
P_INFO = P_INFO
TABLES
P_FORM = P_FORM.
check RETURN is initial.
* remove linetype from generated payslip
loop at p_form.
objbin = p_form-linda.
append objbin.
line_cnt = line_cnt + 1.
endloop.
file_length = line_cnt * 1022.
* create spool file of paylsip
CALL FUNCTION 'SLVC_TABLE_PS_TO_SPOOL'
EXPORTING
i_file_length = file_length
IMPORTING
e_spoolid = spool_id
TABLES
it_textdata = objbin.
IF sy-subrc EQ 0.
WRITE spool_id.
ENDIF.
DESCRIBE table objbin.
DATA PDF LIKE TLINE OCCURS 100 WITH HEADER LINE.
CALL FUNCTION 'CONVERT_ABAPSPOOLJOB_2_PDF'
EXPORTING
SRC_SPOOLID = spool_id
NO_DIALOG = ' '
DST_DEVICE = 'MAIL'
* PDF_DESTINATION =
* IMPORTING
* PDF_BYTECOUNT = l_no_of_bytes
* PDF_SPOOLID = l_pdf_spoolid
* LIST_PAGECOUNT =
* BTC_JOBNAME =
* BTC_JOBCOUNT =
TABLES
PDF = pdf
EXCEPTIONS
ERR_NO_ABAP_SPOOLJOB = 1
ERR_NO_SPOOLJOB = 2
ERR_NO_PERMISSION = 3
ERR_CONV_NOT_POSSIBLE = 4
ERR_BAD_DESTDEVICE = 5
USER_CANCELLED = 6
ERR_SPOOLERROR = 7
ERR_TEMSEERROR = 8
ERR_BTCJOB_OPEN_FAILED = 9
ERR_BTCJOB_SUBMIT_FAILED = 10
ERR_BTCJOB_CLOSE_FAILED = 11
OTHERS = 12
IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
*Download PDF file C Drive
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
filename = 'C:\itab_to_pdf.pdf'
filetype = 'BIN'
TABLES
data_tab = pdf.
* Transfer the 132-long strings to 255-long strings
* LOOP AT pdf.
* TRANSLATE pdf USING ' ~'.
* CONCATENATE gd_buffer pdf INTO gd_buffer.
* ENDLOOP.
* TRANSLATE gd_buffer USING '~ '.
* DO.
* it_mess_att = gd_buffer.
* APPEND it_mess_att.
* SHIFT gd_buffer LEFT BY 255 PLACES.
* IF gd_buffer IS INITIAL.
* EXIT.
* ENDIF.
* ENDDO.
OBJHEAD = 'Objhead'.
append OBJHEAD.
* preparing email subject
concatenate W_ENDDA(6)
' Payslip-'
ITAB-ENAME+0(28)
ITAB-PERNR+4(4) ')'
into DOCDATA-OBJ_DESCR.
DOCDATA-OBJ_NAME = 'Pay Slip'.
DOCDATA-OBJ_LANGU = SY-LANGU.
OBJTXT = 'Pay Slip.'.
append OBJTXT.
*prepare email lines
OBJTXT = DOCDATA-OBJ_DESCR.
append OBJTXT.
OBJTXT = 'Please find enclosed your current payslip.'.
append OBJTXT.
* Write Attachment(Main)
* 3 has been fixed because OBJTXT has fix three lines
read table OBJTXT index 3.
* DOCDATA-DOC_SIZE = ( 3 - 1 ) * 255 + strlen( OBJTXT ).
clear OBJPACK-TRANSF_BIN.
OBJPACK-HEAD_START = 1.
OBJPACK-HEAD_NUM = 0.
OBJPACK-BODY_START = 1.
OBJPACK-BODY_NUM = 3.
OBJPACK-DOC_TYPE = 'RAW'.
append OBJPACK.
* Create Message Attachment
ATT_TYPE = 'PDF'.
describe table OBJBIN lines TAB_LINES.
read table OBJBIN index TAB_LINES.
* OBJPACK-DOC_SIZE = ( TAB_LINES - 1 ) * 255 + strlen( OBJBIN ).
OBJPACK-TRANSF_BIN = 'X'.
OBJPACK-HEAD_START = 1.
OBJPACK-HEAD_NUM = 0.
OBJPACK-BODY_START = 1.
OBJPACK-BODY_NUM = TAB_LINES.
OBJPACK-DOC_TYPE = ATT_TYPE.
OBJPACK-OBJ_NAME = 'ATTACHMENT'.
OBJPACK-OBJ_DESCR = 'Payslip'.
append OBJPACK.
* Create receiver list refresh RECLIST.
clear RECLIST.
RECLIST-RECEIVER = itab-USRID_long.
translate RECLIST-RECEIVER to lower case.
RECLIST-REC_TYPE = 'U'.
append RECLIST.
* Send the document
*SO_NEW_DOCUMENT_ATT_SEND_API1
call function 'SO_DOCUMENT_SEND_API1'
exporting
DOCUMENT_DATA = DOCDATA
PUT_IN_OUTBOX = 'X'
COMMIT_WORK = 'X'
* IMPORTING
* SENT_TO_ALL =
* NEW_OBJECT_ID =
tables
PACKING_LIST = OBJPACK
OBJECT_HEADER = OBJHEAD
CONTENTS_BIN = pdf
CONTENTS_TXT = OBJTXT
* CONTENTS_HEX =
* OBJECT_PARA =
* OBJECT_PARB =
RECEIVERS = RECLIST
exceptions
TOO_MANY_RECEIVERS = 1
DOCUMENT_NOT_SENT = 2
DOCUMENT_TYPE_NOT_EXIST = 3
OPERATION_NO_AUTHORIZATION = 4
PARAMETER_ERROR = 5
X_ERROR = 6
ENQUEUE_ERROR = 7
others = 8.
if SY-SUBRC NE 0.
ITAB-MTEXT = 'Message Not Sent to : '.
else.
ITAB-MTEXT = 'Message Sent to : '.
endif.
* else.
* ITAB-MTEXT = 'Message Not Sent to : '.
* endif.
else.
"SY-SUBRC Not = 0
ITAB-MTEXT = 'Payroll data not found : '.
endif.
"end of SY-SUBRC = 0.
modify ITAB.
endloop. "end loop at ITAB
sort ITAB by MTEXT PERNR.
loop at ITAB.
at new MTEXT.
uline.
write : / ITAB-MTEXT color 4 intensified on.
write : / 'Emp. Code' color 2 intensified on,
12 'Emp. Name' color 2 intensified on,
54 'Email ID' color 2 intensified on.
endat.
write : / ITAB-PERNR, 12 ITAB-ENAME, 54 ITAB-USRID_LONG.
endloop. -
How to add internal table fileds in Text module in smart forms
Hi Friends,
How to add internal table fileds in Text module in smart forms?
Thanks & Regards,
Vallamuthu.MHi Vallamuthu ,
how did you solve your problem?
thanks, -
How to join max os 10.4.5 to Windows Domain?
Hello everyone,
I just bought new mac laptop for work. I have windows 2003 server running. I want to join my mac to domain so its easy to manage computers in the network. i have tried many articales and disussions but there is no working solution.
if someone could guide me on how to join mac OS 10.4.5 to windows 2003 server, it will be greate.
ThanksHello everyone,
I just bought new mac laptop for work. I have windows
2003 server running. I want to join my mac to domain
so its easy to manage computers in the network. i
have tried many articales and disussions but there is
no working solution.
if someone could guide me on how to join mac OS
10.4.5 to windows 2003 server, it will be greate.
Thanks
Thanks for your reply
Again i am using this mac under Windows 2003 server and Exchange 2003, the 2 main components in bussiness. I have gotten email working. If i get mac to join domain i can manage mac through AD (active directory). I know it will not work as windows based workstation but something close.
I am very well aware that i will need windows emulation.
Could you please guide me on what emulation should i use and how it will work?
Thanks -
How to get internal table from SAP Data Provider C#
Hello.
ABAP:
DATA: lt_t001 TYPE TABLE OF t001.
DATA: url(1000) TYPE c.
SELECT * INTO TABLE lt_t001 FROM t001.
CALL FUNCTION 'DP_CREATE_URL'
EXPORTING
type = 'APPLICATION'
subtype = 'X-R3TABLE'
TABLES
data = lt_t001
CHANGING
url = url
EXCEPTIONS
OTHERS = 4.
C#:
using SAPDataProvider;
using SAPTableFactoryCtrl;
public void SetDataFromUrl(string url)
SAPDataProviderClass p = new SAPDataProviderClass();
p.SetDataFromURL("APPLICATION", "X-R3TABLE", url);
ISapDPR3Table tbl = p.GetDataAsR3Table("APPLICATION", "X-R3TABLE");
SAPTableFactoryClass tf = new SAPTableFactoryClass();
Table tb = (Table)tf.NewTable();
tb.ISAPrfcITab = tbl.DataTable; // Exception !!!!!!
How to get internal table from SAP Data Provider ?Hi Sergey,
I'm trying to do the same, have you found a solution to solved it?
thanks for your help.
Regards.
Jonathan -
How to access internal table data from webdynpro to Flex application.
Hi Connoisseur
The data transfer from Abap WebDeypro to flex island works well. I followed , there is an example from Thomas Jung (by the way as always Great Work) and Karthikeyan Venkatesan (Infosys) but this example covers simple type only.
There is no example with complex types like arrayCollection which handle the transfer of data from flex to WebDynpro.
i tried to do pass internal table value to flex-datagrid.but its not work.
i would like to know
1.how to access internal table data from webdynpro to Flex application.
2.how to pass the internal table to flex-datagrid.
2.how to pass dynamically in ADOBE flex.
3. how to do Flex is receiving the wd context data?
4. how can we update WD context with FLEX data.
Ple give me sample example and step by step procedure.
Regards
laxmikanthHi Laxmikanth,
Please refer this...
Flash island: update complex type from flex
Cheers..
kris.
Maybe you are looking for
-
How can I get my library to show on a different computer?
My own laptop is broken. I can use another laptop to access my iTunes account. That laptop already has its own iTunes account, but that doesn't have all my songs on, so I'd like to access my own iTunes library. I can sign in to iTunes on this laptop,
-
My playlists do not sync correctly after I sync my iPhone to iTunes.
I have one playlist that I created on my iPhone with four albums in it. When I synced it to my computer, the playlist on the iPhone only had four songs on it, one from each album. However, when I looked at the playlist on the computer, it had all the
-
Log file restore takes long time
Hi, My log file restore takes very long time to complete, for 128 MB it takes around 3-4 hours, most of the time it is in suspended state and wait type is 'SLEEP_BPOOL_FLUSH' I checked for virtual logs its around 534 files, also there is not disk IO
-
Keyboard freezes when I try to switch users
Hi, I've run into a vey interesting/perplexing problem. My PC has two users on it, one is local with no password and the other not local and password protected. When I try to switch between users my wired USB keyboard becomes unresponsive - if I'm
-
Flash and Google Chrome - CLOSE
EDIT - It has suddenly started working now, but I can't delete this post, sorry!