Friday, January 19, 2024

SAP ABAP System Variable

 System Variable are predefined in SAP

SYST is the Structure for the system Field

All system fields are addressed using SY field

The Various are as follows


SY-SUBRC - system variable for return code (Successful =0 , not  Successful =Other than 0)

SY-TABIX -Returns current line index inside  a loop in Internal table

SY-INDEX - Returns current line index inside DO While loop

SY-DATUM - system Variable for current Date Format (yyyymmdd)


SY-UNAME - LOG ON Name of the User

SY-UZEIT - It returns the current system time


Monday, September 25, 2023

Reading File url from DropBox using Python

 


import dropbox

dbx = dropbox.Dropbox('dropBox_Api-key')

#dbx = dropbox.Dropbox('sl.BP-UylLoDgL_PgQ-TIYsyaQ0TJcp_BiiZgJVKaS2_hn-g2Rl9TGbZ6XabUdhcUiSYow6xF-9uyTIs74GYQkFjJ6T0R81vMbGs-wkMQCN1bo4IquKx-RqRswcneIlHXxg9DCO_bHFBkgN')


#response = dbx.files_list_folder("").entries
#for file in response:
    #print (file.link)
    #print(sharing_create_shared_link(file.path_d   isplay, short_url=False, pending_upload=None))
       
 
#shared_link_metadata = dbx.sharing_create_shared_link_with_settings("/sales2")
#print (shared_link_metadata.links[0].url)
print('---------------------------')
files = dbx.files_list_folder("/KYSALESV1").entries
for file in files:
    #print(file.name)
    shared_link = dbx.sharing_list_shared_links(str("/KYSALESV1/"+ file.name), direct_only=True)
    for item in shared_link.links:
        print(item.url+'|'+file.name)

Sunday, April 16, 2023

SQL Problem ,Recursive CTE

 




WITH  integer_sequence(n) AS (
  SELECT 2019 -- starting value
  UNION ALL
  SELECT n+1 FROM integer_sequence WHERE n < 2021 -- ending value
)
Select customer_id,customer_name,AVG(Amount) from (
Select A.n as bill_Year,A.customer_id ,A.customer_name,ISNULL(Amount,0) AS Amount from (
SELECT * FROM integer_sequence A  cross join  (Select distinct customer_id,customer_name from Test_SQL)B

) A
left outer join  Test_SQL B on  A.n=DATEPART(YEAR,B.ddate) and A.customer_id=B.customer_id

 
) B


group by customer_id,customer_name


Wednesday, March 22, 2023

Useful git command

 git remote  -v  (find he git origin link)

git branch branch-name    (create new branch)

git branch -a (list all branch)

git switch "branch-name"  (switch to another branch)

git merge "branch-name"  (merging branch )


git push --set-upstream origin "branch-name"  update new branch in remote

git log --oneline --all --graph  (list changes in files)



Wednesday, August 31, 2022

Box Plot for All Column

 plt.figure(figsize=(10,10))

sns.boxplot(data=df)
plt.show()

List to Dictionary to DataFrame

#List
height = [151174138186128136179163152131]

weight = [63815691475776726248]


##List to Dictionary

baby_dic = {'height':height,'weight':weight} 



#dictionary to DataFrame

baby_data = pd.DataFrame(baby_dic)

Tuesday, August 30, 2022

Outlier Detecting in Pandas

 Q1 = df_boston['CRIM'].quantile(0.25)

Q3 = df_boston['CRIM'].quantile(0.75)
IQR = Q3 - Q1

Outlier_min = Q1 - 1.5 * IQR 
Outlier_max = Q3 + 1.5 * IQR
print(IQR, Outlier_min, Outlier_max)


###outlier dealing
df_boston['CRIM'] = np.where(df_boston['CRIM']>= Outlier_max, Outlier_max,df_boston['CRIM'])
df_boston['CRIM'] = np.where(df_boston['CRIM']<= Outlier_min, Outlier_min,df_boston['CRIM'])